Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removed all the CDN logic #2230

Merged
merged 1 commit into from
Jun 5, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ CHANGELOG
* @carpasse enhanced events to allow passing a second data argument ([view](https://github.com/videojs/video.js/pull/2163))
* @bc-bbay made the duration display update itself on loadedmetadata ([view](https://github.com/videojs/video.js/pull/2169))
* @arwidt added Swedish and Finnish translations ([view](https://github.com/videojs/video.js/pull/2189))
* @heff moved all the CDN logic into videojs/cdn ([view](https://github.com/videojs/video.js/pull/2230))

--------------------

Expand Down
62 changes: 0 additions & 62 deletions build/cdn.js

This file was deleted.

25 changes: 0 additions & 25 deletions build/tasks/dist-cdn.js

This file was deleted.

7 changes: 4 additions & 3 deletions docs/examples/simple-embed/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,14 @@
<title>Video.js | HTML5 Video Player</title>

<!-- Chang URLs to wherever Video.js files will be hosted -->
<link href="../../../build/temp/video-js.min.css" rel="stylesheet" type="text/css">
<!-- Default URLs assume the examples folder is included alongside video.js -->
<link href="../../video-js.min.css" rel="stylesheet" type="text/css">
<!-- video.js must be in the <head> for older IEs to work. -->
<script src="../../../build/temp/video.min.js"></script>
<script src="../../video.min.js"></script>

<!-- Unless using the CDN hosted version, update the URL to the Flash SWF -->
<script>
videojs.options.flash.swf = "../../../build/temp/video-js.swf";
videojs.options.flash.swf = "../../video-js.swf";
</script>

</head>
Expand Down
5 changes: 5 additions & 0 deletions docs/guides/setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@ You can download the Video.js source and host it on your own servers, or use the
<script src="//vjs.zencdn.net/4.12/video.min.js"></script>
```

We include a stripped down Google Analytics pixel that tracks a random percentage (currently 1%) of players loaded from the CDN. This allows us to see (roughly) what browsers are in use in the wild, along with other useful metrics such as OS and device. If you'd like to disable analytics, you can simply include the following global **before** including Video.js:

```js
window.HELP_IMPROVE_VIDEOJS = false;
```

## Install via package manager

Expand Down
71 changes: 7 additions & 64 deletions grunt.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,64 +89,12 @@ module.exports = function(grunt) {
{expand: true, cwd: 'build/temp/', src: ['*'], dest: 'dist/'+version.full+'/', filter: 'isFile'} // includes files in path
]
},
fonts: { expand: true, cwd: './node_modules/videojs-font/fonts/', src: ['*'], dest: 'build/temp/font/', filter: 'isFile' },
swf: { src: './node_modules/videojs-swf/dist/video-js.swf', dest: './build/temp/video-js.swf' },
novtt: { src: './build/temp/video.js', dest: './build/temp/alt/video.novtt.js' },
dist: { expand: true, cwd: 'build/temp/', src: ['**/**'], dest: 'dist/', filter: 'isFile' },
examples: { expand: true, cwd: 'build/examples/', src: ['**/**'], dest: 'dist/examples/', filter: 'isFile' },
cdn: { expand: true, cwd: 'dist/', src: ['**/**'], dest: 'dist/cdn/', filter: 'isFile' },
},
aws_s3: {
options: {
accessKeyId: process.env.VJS_S3_KEY,
secretAccessKey: process.env.VJS_S3_SECRET,
bucket: process.env.VJS_S3_BUCKET,
access: 'public-read',
uploadConcurrency: 5
},
patch: {
files: [
{
expand: true,
cwd: 'dist/cdn/',
src: ['**'],
dest: 'vjs/'+version.full+'/',
params: { CacheControl: 'public, max-age=31536000' }
}
]
},
minor: {
files: [
{
expand: true,
cwd: 'dist/cdn/',
src: ['**'],
dest: 'vjs/'+version.majorMinor+'/',
params: { CacheControl: 'public, max-age=2628000' }
}
]
}
},
fastly: {
options: {
key: process.env.VJS_FASTLY_API_KEY
},
minor: {
options: {
host: 'vjs.zencdn.net',
urls: [
version.majorMinor+'/*'
]
}
},
patch: {
options: {
host: 'vjs.zencdn.net',
urls: [
version.full+'/*'
]
}
}
fonts: { cwd: 'node_modules/videojs-font/fonts/', src: ['*'], dest: 'build/temp/font/', expand: true, filter: 'isFile' },
swf: { cwd: 'node_modules/videojs-swf/dist/', src: 'video-js.swf', dest: 'build/temp/', expand: true, filter: 'isFile' },
ie8: { cwd: 'node_modules/videojs-ie8/dist/', src: ['**/**'], dest: 'build/temp/ie8/', expand: true, filter: 'isFile' },
novtt: { cwd: 'build/temp/', src: 'video.novtt.js', dest: 'build/temp/alt/', expand: true, filter: 'isFile' },
dist: { cwd: 'build/temp/', src: ['**/**', '!test*'], dest: 'dist/', expand: true, filter: 'isFile' },
examples: { cwd: 'docs/examples/', src: ['**/**'], dest: 'dist/examples/', expand: true, filter: 'isFile' }
},
cssmin: {
minify: {
Expand Down Expand Up @@ -388,6 +336,7 @@ module.exports = function(grunt) {
'cssmin',
'copy:fonts',
'copy:swf',
'copy:ie8',
'vjslanguages'
]);

Expand All @@ -399,12 +348,6 @@ module.exports = function(grunt) {
'zip:dist'
]);

grunt.registerTask('cdn', [
'dist',
'copy:cdn',
'dist-cdn'
]);

// Remove this and add to the test task once mmcc's coverall changes are merged
grunt.registerTask('newtest', ['build', 'karma:chrome']);

Expand Down
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
"lodash-compat": "^3.9.3",
"object.assign": "^2.0.1",
"safe-json-parse": "^4.0.0",
"videojs-font": "1.2.0",
"videojs-ie8": "1.1.0",
"videojs-swf": "4.7.0",
"vtt.js": "git+https://github.com/gkatsev/vtt.js.git#shim-build"
},
Expand Down Expand Up @@ -80,8 +82,7 @@
"sinon": "~1.9.1",
"time-grunt": "^1.1.1",
"uglify-js": "~2.3.6",
"videojs-doc-generator": "0.0.1",
"videojs-font": "^1.1.0"
"videojs-doc-generator": "0.0.1"
},
"standard": {
"ignore": [
Expand Down
1 change: 1 addition & 0 deletions src/css/video-js.scss
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
@import "variables";
@import "utilities";

$icon-font-path: 'font';
@import "../../node_modules/videojs-font/scss/icons";

@import "components/layout";
Expand Down
11 changes: 1 addition & 10 deletions src/js/video.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ setup.autoSetupTimeout(1, videojs);
* Current software version (semver)
* @type {String}
*/
videojs['VERSION'] = '__VERSION__';
videojs.VERSION = '__VERSION__';

/**
* Get the global options object
Expand All @@ -118,15 +118,6 @@ videojs.setGlobalOptions = function(newOptions) {
return mergeOptions(globalOptions, newOptions);
};

// Set CDN Version of swf
const MINOR_VERSION = '__VERSION_NO_PATCH__';
const ACCESS_PROTOCOL = ('https:' === document.location.protocol ? 'https://' : 'http://');

// The added (+) blocks the replace from changing this _VERSION_NO_PATCH_ string
if (MINOR_VERSION !== '__VERSION_'+'NO_PATCH__') {
globalOptions['flash']['swf'] = `${ACCESS_PROTOCOL}vjs.zencdn.net/${MINOR_VERSION}/video-js.swf`;
}

/**
* Get an object with the currently created players, keyed by player ID
*
Expand Down