From 0b392fa9f54d51bac039f8cc103e0a0a2754420f Mon Sep 17 00:00:00 2001 From: Matthew McClure Date: Wed, 25 Feb 2015 16:00:09 -0800 Subject: [PATCH 1/6] breaking grunt tasks out into separate files to clean up the main Gruntfile. Also removed unused requires from the primary Gruntfile and making sure they are in the appropriate task file. --- Gruntfile.js | 400 +++++-------------------------------------- contrib.json | 8 +- package.json | 9 +- tasks/build.js | 41 +++++ tasks/cdn-links.js | 13 ++ tasks/dist-copy.js | 61 +++++++ tasks/minify.js | 55 ++++++ tasks/next-issue.js | 82 +++++++++ tasks/saucelabs.js | 24 +++ tasks/test.js | 63 +++++++ tasks/vjs-version.js | 7 + tasks/vtt.js | 20 +++ 12 files changed, 422 insertions(+), 361 deletions(-) create mode 100644 tasks/build.js create mode 100644 tasks/cdn-links.js create mode 100644 tasks/dist-copy.js create mode 100644 tasks/minify.js create mode 100644 tasks/next-issue.js create mode 100644 tasks/saucelabs.js create mode 100644 tasks/test.js create mode 100644 tasks/vjs-version.js create mode 100644 tasks/vtt.js diff --git a/Gruntfile.js b/Gruntfile.js index 613d2191c..906bbb6c1 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -1,10 +1,7 @@ module.exports = function(grunt) { - var pkg, s3, semver, version, verParts, uglify, exec; + var pkg, s3, version, verParts; - semver = require('semver'); pkg = grunt.file.readJSON('package.json'); - uglify = require('uglify-js'); - exec = require('child_process').exec; verParts = pkg.version.split('.'); version = { @@ -14,6 +11,7 @@ module.exports = function(grunt) { patch: verParts[2] }; version.majorMinor = version.major + '.' + version.minor; + grunt.vjsVersion = version; // loading predefined source order from source-loader.js // trust me, this is the easist way to do it so far @@ -22,6 +20,8 @@ module.exports = function(grunt) { var sourceFiles; // Needed to satisfy jshint eval(grunt.file.read('./build/source-loader.js')); + grunt.sourceFiles = sourceFiles; + // Project configuration. grunt.initConfig({ pkg: pkg, @@ -117,6 +117,27 @@ module.exports = function(grunt) { ] } }, + 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+'/*' + ] + } + } + }, cssmin: { minify: { expand: true, @@ -312,6 +333,22 @@ module.exports = function(grunt) { commit: true, message: 'Release %version%', prefix: 'v' + }, + 'github-release': { + options: { + repository: 'videojs/video.js', + auth: { + user: process.env.VJS_GITHUB_USER, + password: process.env.VJS_GITHUB_TOKEN + }, + release: { + name: version.full, + body: require('chg').find(version.full).changesRaw + } + }, + files: { + src: ['dist/video-js-'+ version.full +'.zip'] // Files that you want to attach to Release + } } }); @@ -333,6 +370,8 @@ module.exports = function(grunt) { grunt.loadNpmTasks('grunt-version'); grunt.loadNpmTasks('grunt-tagrelease'); grunt.loadNpmTasks('chg'); + grunt.loadNpmTasks('grunt-fastly'); + grunt.loadNpmTasks('grunt-github-releaser'); // grunt.loadTasks('./docs/tasks/'); // grunt.loadTasks('../videojs-doc-generator/tasks/'); @@ -344,357 +383,8 @@ module.exports = function(grunt) { grunt.registerTask('dev', ['jshint', 'less', 'vjslanguages', 'build', 'qunit:source']); grunt.registerTask('test-qunit', ['pretask', 'qunit']); - // The test task will run `karma:saucelabs` when running in travis, - // when running via a PR from a fork, it'll run qunit tests in phantom using - // karma otherwise, it'll run the tests in chrome via karma - // You can specify which browsers to build with by using grunt-style arguments - // or separating them with a comma: - // grunt test:chrome:firefox # grunt-style - // grunt test:chrome,firefox # comma-separated - grunt.registerTask('test', function() { - var tasks = this.args, - tasksMinified, - tasksMinifiedApi; - - grunt.task.run(['pretask']); - - if (process.env.TRAVIS_PULL_REQUEST !== 'false') { - grunt.task.run(['karma:phantomjs', 'karma:minified_phantomjs', 'karma:minified_api_phantomjs']); - } else if (process.env.TRAVIS) { - grunt.task.run(['karma:phantomjs', 'karma:minified_phantomjs', 'karma:minified_api_phantomjs']); - //Disabling saucelabs until we figure out how to make it run reliably. - //grunt.task.run([ - //'karma:chrome_sl', - //'karma:firefox_sl', - //'karma:safari_sl', - //'karma:ipad_sl', - //'karma:android_sl', - //'karma:ie_sl' - //]); - } else { - // if we aren't running this in a CI, but running it manually, we can - // supply arguments to this task. These arguments are either colon (`:`) - // separated which is the default grunt separator for arguments, or they - // are comma (`,`) separated to make it easier. - // The arguments are the names of which browsers you want. It'll then - // make sure you have the `minified` and `minified_api` for those browsers - // as well. - if (tasks.length === 0) { - tasks.push('chrome'); - } - if (tasks.length === 1) { - tasks = tasks[0].split(','); - } - - tasksMinified = tasks.slice(); - tasksMinifiedApi = tasks.slice(); - - tasksMinified = tasksMinified.map(function(task) { - return 'minified_' + task; - }); - - tasksMinifiedApi = tasksMinifiedApi.map(function(task) { - return 'minified_api_' + task; - }); - - tasks = tasks.concat(tasksMinified).concat(tasksMinifiedApi); - tasks = tasks.map(function(task) { - return 'karma:' + task; - }); - - grunt.task.run(tasks); - } - }); - - grunt.registerTask('saucelabs', function() { - var done = this.async(); - - if (this.args[0] == 'connect') { - exec('curl https://gist.githubusercontent.com/santiycr/5139565/raw/sauce_connect_setup.sh | bash', - function(error, stdout, stderr) { - if (error) { - grunt.log.error(error); - return done(); - } - - grunt.verbose.error(stderr.toString()); - grunt.verbose.writeln(stdout.toString()); - grunt.task.run(['karma:saucelabs']); - done(); - }); - } else { - grunt.task.run(['karma:saucelabs']); - done(); - } - }); - - var fs = require('fs'); - - grunt.registerTask('vttjs', 'prepend vttjs to videojs source files', function() { - var vttjs, vttjsMin, vjs, vjsMin; - - // copy the current files to make a novttjs build - grunt.file.copy('build/files/combined.video.js', 'build/files/combined.video.novtt.js'); - grunt.file.copy('build/files/minified.video.js', 'build/files/minified.video.novtt.js'); - - // read in vttjs files - vttjs = grunt.file.read('node_modules/vtt.js/dist/vtt.js'); - vttjsMin = grunt.file.read('node_modules/vtt.js/dist/vtt.min.js'); - - // read in videojs files - vjs = grunt.file.read('build/files/combined.video.js'); - vjsMin = grunt.file.read('build/files/minified.video.js'); - - // write out the concatenated files - grunt.file.write('build/files/combined.video.js', vjs + '\n' + vttjs); - grunt.file.write('build/files/minified.video.js', vjsMin + '\n' + vttjsMin); - }); - - grunt.registerMultiTask('build', 'Building Source', function(){ - - // Fix windows file path delimiter issue - var i = sourceFiles.length; - while (i--) { - sourceFiles[i] = sourceFiles[i].replace(/\\/g, '/'); - } - - // Create a combined sources file. https://github.com/zencoder/video-js/issues/287 - var combined = ''; - sourceFiles.forEach(function(result){ - combined += grunt.file.read(result); - }); - // Replace CDN version ref in js. Use major/minor version. - combined = combined.replace(/GENERATED_CDN_VSN/g, version.majorMinor); - combined = combined.replace(/GENERATED_FULL_VSN/g, version.full); - - grunt.file.write('build/files/combined.video.js', combined); - - // Copy over other files - // grunt.file.copy('src/css/video-js.png', 'build/files/video-js.png'); - grunt.file.copy('node_modules/videojs-swf/dist/video-js.swf', 'build/files/video-js.swf'); - - // Inject version number into css file - var css = grunt.file.read('build/files/video-js.css'); - css = css.replace(/GENERATED_AT_BUILD/g, version.full); - grunt.file.write('build/files/video-js.css', css); - - // Copy over font files - grunt.file.recurse('src/css/font', function(absdir, rootdir, subdir, filename) { - // Block .DS_Store files - if ('filename'.substring(0,1) !== '.') { - grunt.file.copy(absdir, 'build/files/font/' + filename); - } - }); - - // Minify CSS - grunt.task.run(['cssmin']); - }); - - grunt.registerMultiTask('minify', 'Minify JS files using Closure Compiler.', function() { - var done = this.async(); - var exec = require('child_process').exec; - - var externs = this.data.externs || []; - var dest = this.data.dest; - var filePatterns = []; - - // Make sure deeper directories exist for compiler - grunt.file.write(dest, ''); - - if (this.data.sourcelist) { - filePatterns = filePatterns.concat(grunt.file.read(this.data.sourcelist).split(',')); - } - if (this.data.src) { - filePatterns = filePatterns.concat(this.data.src); - } - - // Build closure compiler shell command - var command = 'java -jar build/compiler/compiler.jar' - + ' --compilation_level ADVANCED_OPTIMIZATIONS' - // + ' --formatting=pretty_print' - + ' --js_output_file=' + dest - + ' --create_source_map ' + dest + '.map --source_map_format=V3' - + ' --jscomp_warning=checkTypes --warning_level=VERBOSE' - + ' --output_wrapper "(function() {%output%})();"'; - //@ sourceMappingURL=video.js.map - - // Add each js file - grunt.file.expand(filePatterns).forEach(function(file){ - command += ' --js='+file; - }); - - // Add externs - externs.forEach(function(extern){ - command += ' --externs='+extern; - }); - - // Run command - exec(command, { maxBuffer: 500*1024 }, function(err, stdout, stderr){ - - if (err) { - grunt.warn(err); - done(false); - } - - if (stdout) { - grunt.log.writeln(stdout); - } - - done(); - }); - }); - - grunt.registerTask('dist-copy', 'Assembling distribution', function(){ - var css, jsmin, jsdev, cdnjs; - - // Manually copy each source file - grunt.file.copy('build/files/minified.video.js', 'dist/video-js/video.js'); - grunt.file.copy('build/files/combined.video.js', 'dist/video-js/video.dev.js'); - grunt.file.copy('build/files/minified.video.novtt.js', 'dist/video-js/video.novtt.js'); - grunt.file.copy('build/files/combined.video.novtt.js', 'dist/video-js/video.novtt.dev.js'); - grunt.file.copy('build/files/video-js.css', 'dist/video-js/video-js.css'); - grunt.file.copy('build/files/video-js.min.css', 'dist/video-js/video-js.min.css'); - grunt.file.copy('node_modules/videojs-swf/dist/video-js.swf', 'dist/video-js/video-js.swf'); - grunt.file.copy('build/demo-files/demo.html', 'dist/video-js/demo.html'); - grunt.file.copy('build/demo-files/demo.captions.vtt', 'dist/video-js/demo.captions.vtt'); - grunt.file.copy('src/css/video-js.less', 'dist/video-js/video-js.less'); - - - // Copy over font files - grunt.file.recurse('build/files/font', function(absdir, rootdir, subdir, filename) { - // Block .DS_Store files - if ('filename'.substring(0,1) !== '.') { - grunt.file.copy(absdir, 'dist/video-js/font/' + filename); - } - }); - - // Copy over language files - grunt.file.recurse('build/files/lang', function(absdir, rootdir, subdir, filename) { - // Block .DS_Store files - if ('filename'.substring(0,1) !== '.') { - grunt.file.copy(absdir, 'dist/cdn/lang/' + filename); - grunt.file.copy(absdir, 'dist/video-js/lang/' + filename); - } - }); - - // ds_store files sometime find their way in - if (grunt.file.exists('dist/video-js/.DS_Store')) { - grunt.file['delete']('dist/video-js/.DS_Store'); - } - - // CDN version uses already hosted font files - // Minified version only, doesn't need demo files - grunt.file.copy('build/files/minified.video.js', 'dist/cdn/video.js'); - grunt.file.copy('build/files/video-js.min.css', 'dist/cdn/video-js.css'); - grunt.file.copy('node_modules/videojs-swf/dist/video-js.swf', 'dist/cdn/video-js.swf'); - grunt.file.copy('build/demo-files/demo.captions.vtt', 'dist/cdn/demo.captions.vtt'); - grunt.file.copy('build/demo-files/demo.html', 'dist/cdn/demo.html'); - - // Replace font urls with CDN versions - css = grunt.file.read('dist/cdn/video-js.css'); - css = css.replace(/font\//g, '../f/3/'); - grunt.file.write('dist/cdn/video-js.css', css); - - // Add CDN-specfic JS - jsmin = grunt.file.read('dist/cdn/video.js'); - // GA Tracking Pixel (manually building the pixel URL) - cdnjs = uglify.minify('src/js/cdn.js').code.replace('v0.0.0', 'v'+version.full); - grunt.file.write('dist/cdn/video.js', jsmin + cdnjs); - }); - - grunt.registerTask('cdn-links', 'Update the version of CDN links in docs', function(){ - var doc = grunt.file.read('docs/guides/setup.md'); - var version = pkg.version; - - // remove the patch version to point to the latest patch - version = version.replace(/(\d+\.\d+)\.\d+/, '$1'); - - // update the version in http://vjs.zencdn.net/4.3/video.js - doc = doc.replace(/(\/\/vjs\.zencdn\.net\/)\d+\.\d+(\.\d+)?/g, '$1'+version); - grunt.file.write('docs/guides/setup.md', doc); - }); - grunt.registerTask('dist', 'Creating distribution', ['dist-copy', 'zip:dist']); - grunt.registerTask('next-issue', 'Get the next issue that needs a response', function(){ - var done = this.async(); - var GitHubApi = require('github'); - var open = require('open'); - - var github = new GitHubApi({ - // required - version: '3.0.0', - // optional - debug: true, - protocol: 'https', - // host: 'github.my-GHE-enabled-company.com', - // pathPrefix: '/api/v3', // for some GHEs - timeout: 5000 - }); - - github.issues.repoIssues({ - // optional: - // headers: { - // 'cookie': 'blahblah' - // }, - user: 'videojs', - repo: 'video.js', - sort: 'updated', - direction: 'asc', - state: 'open', - per_page: 100 - }, function(err, res) { - var issueToOpen; - var usersWithWrite = ['heff', 'mmcc']; - var categoryLabels = ['enhancement', 'bug', 'question', 'feature']; - - console.log('Number of issues: '+res.length); - - // TODO: Find the best way to exclude an issue where a question has been asked of the - // issue owner/submitter that hasn't been answerd yet. - // A stupid simple first step would be to check for the needs: more info label - // and exactly one comment (the question) - - // find issues that need categorizing, no category labels - res.some(function(issue){ - if (issue.labels.length === 0) { - return issueToOpen = issue; // break - } - // look for category labels - var categorized = issue.labels.some(function(label){ - return categoryLabels.indexOf(label.name) >= 0; - }); - if (!categorized) { - return issueToOpen = issue; // break - } - }); - if (issueToOpen) { - open(issueToOpen.html_url); - return done(); - } - - // find issues that need confirming or answering - res.some(function(issue){ - // look for confirmed label - var confirmed = issue.labels.some(function(label){ - return label.name === 'confirmed'; - }); - // Was exluding questions, but that might leave a lot of people hanging - // var question = issue.labels.some(function(label){ - // return label.name === 'question'; - // }); - if (!confirmed) { // && !question - return issueToOpen = issue; // break - } - }); - if (issueToOpen) { - open(issueToOpen.html_url); - return done(); - } - - grunt.log.writeln('No next issue found'); - done(); - }); - }); - + // Load all the tasks in the tasks directory + grunt.loadTasks('tasks'); }; diff --git a/contrib.json b/contrib.json index 5cc84d514..fa209639b 100644 --- a/contrib.json +++ b/contrib.json @@ -202,8 +202,11 @@ [ "git pull upstream stable", "Update the release branch" ], [ "npm install", "Ensure dependency updates have been installed" ], [ "grunt test", "Run tests" ], - [ "grunt chg-release:{{ release_type }}", "Update the changelog with the new release" ], [ "grunt version:{{ release_type }}", "Bump package versions" ], + { "exec": "grunt vjs-version", + "id": "version", "desc": "Return the current VJS Version from the package.json file"}, + [ "grunt chg-release:{{ version }}", "Update the changelog with the new release" ], + [ "grunt clean:dist", "Clean out the dist folder before the build" ], [ "grunt", "Build the release" ], [ "git add dist/video-js --force", "Add the (otherwise ignored) release files" ], [ "grunt vjsdocs", "Rebuild the docs" ], @@ -212,10 +215,11 @@ [ "git push upstream stable", "Push changes to the remote" ], [ "git push upstream --tags", "Push tags to the remote" ], [ "npm publish", "Publish to npm" ], + [ "grunt github-release", "Create a new release on Github"], [ "git checkout master", "Checkout the development branch" ], [ "git pull upstream master", "Update the development branch" ], [ "git merge stable", "Merge changes" ], - [ "grunt clean:dist", "Remove built dist files to re-ignore them" ], + [ "grunt clean:dist", "Remove built dist files again to re-ignore them" ], [ "git add -u", "Add the changes for the removed dist files" ], [ "git commit -m 'Removed dist files'", "Commit the removed dist files" ], [ "git push upstream master", "Push development branch changes" ] diff --git a/package.json b/package.json index 18930373f..6ed420cde 100644 --- a/package.json +++ b/package.json @@ -26,7 +26,7 @@ }, "devDependencies": { "calcdeps": "~0.1.7", - "chg": "~0.1.8", + "chg": "~0.2.0", "contribflow": "~0.2.0", "github": "~0.1.14", "grunt": "^0.4.4", @@ -40,10 +40,13 @@ "grunt-contrib-less": "~0.6.4", "grunt-contrib-qunit": "~0.2.1", "grunt-contrib-watch": "~0.1.4", + "grunt-fastly": "^0.1.3", + "grunt-github-releaser": "^0.1.17", "grunt-karma": "^0.8.3", "grunt-s3": "~0.2.0-alpha", "grunt-tagrelease": "~0.3.3", "grunt-version": "~0.3.0", + "grunt-videojs-languages": "0.0.4", "grunt-zip": "0.10.2", "karma": "^0.12.14", "karma-chrome-launcher": "^0.1.3", @@ -58,10 +61,8 @@ "mocha": "~1.8.1", "open": "0.0.4", "qunitjs": "~1.14.0", - "semver": "~1.1.4", "sinon": "~1.9.1", "uglify-js": "~2.3.6", - "videojs-doc-generator": "0.0.1", - "grunt-videojs-languages": "0.0.4" + "videojs-doc-generator": "0.0.1" } } diff --git a/tasks/build.js b/tasks/build.js new file mode 100644 index 000000000..10b5d4e7c --- /dev/null +++ b/tasks/build.js @@ -0,0 +1,41 @@ +module.exports = function(grunt) { + grunt.registerMultiTask('build', 'Building Source', function(){ + + // Fix windows file path delimiter issue + var i = grunt.sourceFiles.length; + while (i--) { + grunt.sourceFiles[i] = grunt.sourceFiles[i].replace(/\\/g, '/'); + } + + // Create a combined sources file. https://github.com/zencoder/video-js/issues/287 + var combined = ''; + grunt.sourceFiles.forEach(function(result){ + combined += grunt.file.read(result); + }); + // Replace CDN version ref in js. Use major/minor version. + combined = combined.replace(/GENERATED_CDN_VSN/g, grunt.vjsVersion.majorMinor); + combined = combined.replace(/GENERATED_FULL_VSN/g, grunt.vjsVersion.full); + + grunt.file.write('build/files/combined.video.js', combined); + + // Copy over other files + // grunt.file.copy('src/css/video-js.png', 'build/files/video-js.png'); + grunt.file.copy('node_modules/videojs-swf/dist/video-js.swf', 'build/files/video-js.swf'); + + // Inject version number into css file + var css = grunt.file.read('build/files/video-js.css'); + css = css.replace(/GENERATED_AT_BUILD/g, grunt.vjsVersion.full); + grunt.file.write('build/files/video-js.css', css); + + // Copy over font files + grunt.file.recurse('src/css/font', function(absdir, rootdir, subdir, filename) { + // Block .DS_Store files + if ('filename'.substring(0,1) !== '.') { + grunt.file.copy(absdir, 'build/files/font/' + filename); + } + }); + + // Minify CSS + grunt.task.run(['cssmin']); + }); +} diff --git a/tasks/cdn-links.js b/tasks/cdn-links.js new file mode 100644 index 000000000..ca59b015c --- /dev/null +++ b/tasks/cdn-links.js @@ -0,0 +1,13 @@ +module.exports = function(grunt) { + grunt.registerTask('cdn-links', 'Update the version of CDN links in docs', function(){ + var doc = grunt.file.read('docs/guides/setup.md'); + var version = pkg.version; + + // remove the patch version to point to the latest patch + version = version.replace(/(\d+\.\d+)\.\d+/, '$1'); + + // update the version in http://vjs.zencdn.net/4.3/video.js + doc = doc.replace(/(\/\/vjs\.zencdn\.net\/)\d+\.\d+(\.\d+)?/g, '$1'+version); + grunt.file.write('docs/guides/setup.md', doc); + }); +}; diff --git a/tasks/dist-copy.js b/tasks/dist-copy.js new file mode 100644 index 000000000..160d5bbc2 --- /dev/null +++ b/tasks/dist-copy.js @@ -0,0 +1,61 @@ +module.exports = function(grunt) { + grunt.registerTask('dist-copy', 'Assembling distribution', function(){ + var css, jsmin, jsdev, cdnjs, uglify; + + uglify = require('uglify-js'); + + // Manually copy each source file + grunt.file.copy('build/files/minified.video.js', 'dist/video-js/video.js'); + grunt.file.copy('build/files/combined.video.js', 'dist/video-js/video.dev.js'); + grunt.file.copy('build/files/minified.video.novtt.js', 'dist/video-js/video.novtt.js'); + grunt.file.copy('build/files/combined.video.novtt.js', 'dist/video-js/video.novtt.dev.js'); + grunt.file.copy('build/files/video-js.css', 'dist/video-js/video-js.css'); + grunt.file.copy('build/files/video-js.min.css', 'dist/video-js/video-js.min.css'); + grunt.file.copy('node_modules/videojs-swf/dist/video-js.swf', 'dist/video-js/video-js.swf'); + grunt.file.copy('build/demo-files/demo.html', 'dist/video-js/demo.html'); + grunt.file.copy('build/demo-files/demo.captions.vtt', 'dist/video-js/demo.captions.vtt'); + grunt.file.copy('src/css/video-js.less', 'dist/video-js/video-js.less'); + + + // Copy over font files + grunt.file.recurse('build/files/font', function(absdir, rootdir, subdir, filename) { + // Block .DS_Store files + if ('filename'.substring(0,1) !== '.') { + grunt.file.copy(absdir, 'dist/video-js/font/' + filename); + } + }); + + // Copy over language files + grunt.file.recurse('build/files/lang', function(absdir, rootdir, subdir, filename) { + // Block .DS_Store files + if ('filename'.substring(0,1) !== '.') { + grunt.file.copy(absdir, 'dist/cdn/lang/' + filename); + grunt.file.copy(absdir, 'dist/video-js/lang/' + filename); + } + }); + + // ds_store files sometime find their way in + if (grunt.file.exists('dist/video-js/.DS_Store')) { + grunt.file['delete']('dist/video-js/.DS_Store'); + } + + // CDN version uses already hosted font files + // Minified version only, doesn't need demo files + grunt.file.copy('build/files/minified.video.js', 'dist/cdn/video.js'); + grunt.file.copy('build/files/video-js.min.css', 'dist/cdn/video-js.css'); + grunt.file.copy('node_modules/videojs-swf/dist/video-js.swf', 'dist/cdn/video-js.swf'); + grunt.file.copy('build/demo-files/demo.captions.vtt', 'dist/cdn/demo.captions.vtt'); + grunt.file.copy('build/demo-files/demo.html', 'dist/cdn/demo.html'); + + // Replace font urls with CDN versions + css = grunt.file.read('dist/cdn/video-js.css'); + css = css.replace(/font\//g, '../f/3/'); + grunt.file.write('dist/cdn/video-js.css', css); + + // Add CDN-specfic JS + jsmin = grunt.file.read('dist/cdn/video.js'); + // GA Tracking Pixel (manually building the pixel URL) + cdnjs = uglify.minify('src/js/cdn.js').code.replace('v0.0.0', 'v'+ grunt.vjsVersion.full); + grunt.file.write('dist/cdn/video.js', jsmin + cdnjs); + }); +} diff --git a/tasks/minify.js b/tasks/minify.js new file mode 100644 index 000000000..09ec6e121 --- /dev/null +++ b/tasks/minify.js @@ -0,0 +1,55 @@ +module.exports = function(grunt) { + grunt.registerMultiTask('minify', 'Minify JS files using Closure Compiler.', function() { + var done = this.async(); + var exec = require('child_process').exec; + + var externs = this.data.externs || []; + var dest = this.data.dest; + var filePatterns = []; + + // Make sure deeper directories exist for compiler + grunt.file.write(dest, ''); + + if (this.data.sourcelist) { + filePatterns = filePatterns.concat(grunt.file.read(this.data.sourcelist).split(',')); + } + if (this.data.src) { + filePatterns = filePatterns.concat(this.data.src); + } + + // Build closure compiler shell command + var command = 'java -jar build/compiler/compiler.jar' + + ' --compilation_level ADVANCED_OPTIMIZATIONS' + // + ' --formatting=pretty_print' + + ' --js_output_file=' + dest + + ' --create_source_map ' + dest + '.map --source_map_format=V3' + + ' --jscomp_warning=checkTypes --warning_level=VERBOSE' + + ' --output_wrapper "(function() {%output%})();"'; + //@ sourceMappingURL=video.js.map + + // Add each js file + grunt.file.expand(filePatterns).forEach(function(file){ + command += ' --js='+file; + }); + + // Add externs + externs.forEach(function(extern){ + command += ' --externs='+extern; + }); + + // Run command + exec(command, { maxBuffer: 500*1024 }, function(err, stdout, stderr){ + + if (err) { + grunt.warn(err); + done(false); + } + + if (stdout) { + grunt.log.writeln(stdout); + } + + done(); + }); + }); +} diff --git a/tasks/next-issue.js b/tasks/next-issue.js new file mode 100644 index 000000000..dee2b01a7 --- /dev/null +++ b/tasks/next-issue.js @@ -0,0 +1,82 @@ +module.exports = function(grunt) { + grunt.registerTask('next-issue', 'Get the next issue that needs a response', function(){ + var done = this.async(); + var GitHubApi = require('github'); + var open = require('open'); + + var github = new GitHubApi({ + // required + version: '3.0.0', + // optional + debug: true, + protocol: 'https', + // host: 'github.my-GHE-enabled-company.com', + // pathPrefix: '/api/v3', // for some GHEs + timeout: 5000 + }); + + github.issues.repoIssues({ + // optional: + // headers: { + // 'cookie': 'blahblah' + // }, + user: 'videojs', + repo: 'video.js', + sort: 'updated', + direction: 'asc', + state: 'open', + per_page: 100 + }, function(err, res) { + var issueToOpen; + var usersWithWrite = ['heff', 'mmcc']; + var categoryLabels = ['enhancement', 'bug', 'question', 'feature']; + + console.log('Number of issues: '+res.length); + + // TODO: Find the best way to exclude an issue where a question has been asked of the + // issue owner/submitter that hasn't been answerd yet. + // A stupid simple first step would be to check for the needs: more info label + // and exactly one comment (the question) + + // find issues that need categorizing, no category labels + res.some(function(issue){ + if (issue.labels.length === 0) { + return issueToOpen = issue; // break + } + // look for category labels + var categorized = issue.labels.some(function(label){ + return categoryLabels.indexOf(label.name) >= 0; + }); + if (!categorized) { + return issueToOpen = issue; // break + } + }); + if (issueToOpen) { + open(issueToOpen.html_url); + return done(); + } + + // find issues that need confirming or answering + res.some(function(issue){ + // look for confirmed label + var confirmed = issue.labels.some(function(label){ + return label.name === 'confirmed'; + }); + // Was exluding questions, but that might leave a lot of people hanging + // var question = issue.labels.some(function(label){ + // return label.name === 'question'; + // }); + if (!confirmed) { // && !question + return issueToOpen = issue; // break + } + }); + if (issueToOpen) { + open(issueToOpen.html_url); + return done(); + } + + grunt.log.writeln('No next issue found'); + done(); + }); + }); +} diff --git a/tasks/saucelabs.js b/tasks/saucelabs.js new file mode 100644 index 000000000..2873c8621 --- /dev/null +++ b/tasks/saucelabs.js @@ -0,0 +1,24 @@ +module.exports = function(grunt) { + grunt.registerTask('saucelabs', function() { + var exec = require('child_process').exec; + var done = this.async(); + + if (this.args[0] == 'connect') { + exec('curl https://gist.githubusercontent.com/santiycr/5139565/raw/sauce_connect_setup.sh | bash', + function(error, stdout, stderr) { + if (error) { + grunt.log.error(error); + return done(); + } + + grunt.verbose.error(stderr.toString()); + grunt.verbose.writeln(stdout.toString()); + grunt.task.run(['karma:saucelabs']); + done(); + }); + } else { + grunt.task.run(['karma:saucelabs']); + done(); + } + }); +} diff --git a/tasks/test.js b/tasks/test.js new file mode 100644 index 000000000..3f74b8d7a --- /dev/null +++ b/tasks/test.js @@ -0,0 +1,63 @@ +module.exports = function(grunt) { + // The test task will run `karma:saucelabs` when running in travis, + // when running via a PR from a fork, it'll run qunit tests in phantom using + // karma otherwise, it'll run the tests in chrome via karma + // You can specify which browsers to build with by using grunt-style arguments + // or separating them with a comma: + // grunt test:chrome:firefox # grunt-style + // grunt test:chrome,firefox # comma-separated + grunt.registerTask('test', function() { + var tasks = this.args, + tasksMinified, + tasksMinifiedApi; + + grunt.task.run(['pretask']); + + if (process.env.TRAVIS_PULL_REQUEST !== 'false') { + grunt.task.run(['karma:phantomjs', 'karma:minified_phantomjs', 'karma:minified_api_phantomjs']); + } else if (process.env.TRAVIS) { + grunt.task.run(['karma:phantomjs', 'karma:minified_phantomjs', 'karma:minified_api_phantomjs']); + //Disabling saucelabs until we figure out how to make it run reliably. + //grunt.task.run([ + //'karma:chrome_sl', + //'karma:firefox_sl', + //'karma:safari_sl', + //'karma:ipad_sl', + //'karma:android_sl', + //'karma:ie_sl' + //]); + } else { + // if we aren't running this in a CI, but running it manually, we can + // supply arguments to this task. These arguments are either colon (`:`) + // separated which is the default grunt separator for arguments, or they + // are comma (`,`) separated to make it easier. + // The arguments are the names of which browsers you want. It'll then + // make sure you have the `minified` and `minified_api` for those browsers + // as well. + if (tasks.length === 0) { + tasks.push('chrome'); + } + if (tasks.length === 1) { + tasks = tasks[0].split(','); + } + + tasksMinified = tasks.slice(); + tasksMinifiedApi = tasks.slice(); + + tasksMinified = tasksMinified.map(function(task) { + return 'minified_' + task; + }); + + tasksMinifiedApi = tasksMinifiedApi.map(function(task) { + return 'minified_api_' + task; + }); + + tasks = tasks.concat(tasksMinified).concat(tasksMinifiedApi); + tasks = tasks.map(function(task) { + return 'karma:' + task; + }); + + grunt.task.run(tasks); + } + }); +}; diff --git a/tasks/vjs-version.js b/tasks/vjs-version.js new file mode 100644 index 000000000..12b129a4c --- /dev/null +++ b/tasks/vjs-version.js @@ -0,0 +1,7 @@ +module.exports = function(grunt) { + grunt.registerTask('vjs-version', function() { + var version = grunt.vjsVersion.full; + grunt.log.writeln(version); + return version; + }); +} diff --git a/tasks/vtt.js b/tasks/vtt.js new file mode 100644 index 000000000..3407c8e4e --- /dev/null +++ b/tasks/vtt.js @@ -0,0 +1,20 @@ +module.exports = function(grunt) { + grunt.registerTask('vttjs', 'prepend vttjs to videojs source files', function() { + var vttjs, vttjsMin, vjs, vjsMin; + + // copy the current files to make a novttjs build + grunt.file.copy('build/files/combined.video.js', 'build/files/combined.video.novtt.js'); + grunt.file.copy('build/files/minified.video.js', 'build/files/minified.video.novtt.js'); + + // read in vttjs files + vttjs = grunt.file.read('node_modules/vtt.js/dist/vtt.js'); + vttjsMin = grunt.file.read('node_modules/vtt.js/dist/vtt.min.js'); + // read in videojs files + vjs = grunt.file.read('build/files/combined.video.js'); + vjsMin = grunt.file.read('build/files/minified.video.js'); + + // write out the concatenated files + grunt.file.write('build/files/combined.video.js', vjs + '\n' + vttjs); + grunt.file.write('build/files/minified.video.js', vjsMin + '\n' + vttjsMin); + }); +}; From 2a1f9f357f30000094f10864486e143dacbc448d Mon Sep 17 00:00:00 2001 From: Gary Katsevman Date: Wed, 25 Feb 2015 16:12:01 -0800 Subject: [PATCH 2/6] @gkatsev fixed disabling of default text tracks. closes #1892 --- CHANGELOG.md | 2 +- src/js/media/html5.js | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b482633f9..43175d424 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,7 @@ CHANGELOG ========= ## HEAD (Unreleased) -_(none)_ +* @gkatsev fixed disabling of default text tracks ([view](https://github.com/videojs/video.js/pull/1892)) -------------------- diff --git a/src/js/media/html5.js b/src/js/media/html5.js index 4cb83ae5b..ee55d54e6 100644 --- a/src/js/media/html5.js +++ b/src/js/media/html5.js @@ -167,7 +167,7 @@ vjs.Html5.prototype.createEl = function(){ vjs.Html5.prototype.hideCaptions = function() { - var tracks = this.el_.textTracks, + var tracks = this.el_.querySelectorAll('track'), track, i = tracks.length, kinds = { @@ -176,8 +176,9 @@ vjs.Html5.prototype.hideCaptions = function() { }; while (i--) { - track = tracks[i]; - if (track && track['kind'] in kinds) { + track = tracks[i].track; + if ((track && track['kind'] in kinds) && + (!tracks[i]['default'])) { track.mode = 'disabled'; } } From bbad7207a2cf81f6b6608b3a42d5f490a4ff4823 Mon Sep 17 00:00:00 2001 From: Matthew McClure Date: Wed, 25 Feb 2015 17:13:52 -0800 Subject: [PATCH 3/6] fixing undefined package reference in cdn-links task --- tasks/cdn-links.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tasks/cdn-links.js b/tasks/cdn-links.js index ca59b015c..699f05f0f 100644 --- a/tasks/cdn-links.js +++ b/tasks/cdn-links.js @@ -1,7 +1,7 @@ module.exports = function(grunt) { grunt.registerTask('cdn-links', 'Update the version of CDN links in docs', function(){ var doc = grunt.file.read('docs/guides/setup.md'); - var version = pkg.version; + var version = require('../package.json').version; // remove the patch version to point to the latest patch version = version.replace(/(\d+\.\d+)\.\d+/, '$1'); From 6e6c9fe885f3a993995a2cfa936a66e895f4dc05 Mon Sep 17 00:00:00 2001 From: Matthew McClure Date: Thu, 26 Feb 2015 15:05:16 -0800 Subject: [PATCH 4/6] remove tagrelease and commit unstaged changes manually (github-release handles tagging) --- Gruntfile.js | 8 +------- contrib.json | 5 ++--- package.json | 1 - 3 files changed, 3 insertions(+), 11 deletions(-) diff --git a/Gruntfile.js b/Gruntfile.js index 906bbb6c1..f3bb0bbf8 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -328,12 +328,6 @@ module.exports = function(grunt) { src: ['package.json', 'bower.json', 'component.json'] } }, - tagrelease: { - file: 'package.json', - commit: true, - message: 'Release %version%', - prefix: 'v' - }, 'github-release': { options: { repository: 'videojs/video.js', @@ -342,6 +336,7 @@ module.exports = function(grunt) { password: process.env.VJS_GITHUB_TOKEN }, release: { + tag_name: 'v'+ version.full, name: version.full, body: require('chg').find(version.full).changesRaw } @@ -368,7 +363,6 @@ module.exports = function(grunt) { grunt.loadNpmTasks('grunt-zip'); grunt.loadNpmTasks('grunt-banner'); grunt.loadNpmTasks('grunt-version'); - grunt.loadNpmTasks('grunt-tagrelease'); grunt.loadNpmTasks('chg'); grunt.loadNpmTasks('grunt-fastly'); grunt.loadNpmTasks('grunt-github-releaser'); diff --git a/contrib.json b/contrib.json index fa209639b..455c4fcca 100644 --- a/contrib.json +++ b/contrib.json @@ -203,15 +203,14 @@ [ "npm install", "Ensure dependency updates have been installed" ], [ "grunt test", "Run tests" ], [ "grunt version:{{ release_type }}", "Bump package versions" ], - { "exec": "grunt vjs-version", - "id": "version", "desc": "Return the current VJS Version from the package.json file"}, + [ "grunt vjs-version", "Return the current VJS Version from the package.json file", "version" ], [ "grunt chg-release:{{ version }}", "Update the changelog with the new release" ], [ "grunt clean:dist", "Clean out the dist folder before the build" ], [ "grunt", "Build the release" ], [ "git add dist/video-js --force", "Add the (otherwise ignored) release files" ], [ "grunt vjsdocs", "Rebuild the docs" ], [ "grunt cdn-links", "Update the cdn urls in the docs" ], - [ "grunt tagrelease", "Tag the release" ], + [ "git commit -am 'Release v{{ version }}'", "Commit the unstaged changes (package.json, changelog, etc)" ], [ "git push upstream stable", "Push changes to the remote" ], [ "git push upstream --tags", "Push tags to the remote" ], [ "npm publish", "Publish to npm" ], diff --git a/package.json b/package.json index 6ed420cde..2edba0fed 100644 --- a/package.json +++ b/package.json @@ -44,7 +44,6 @@ "grunt-github-releaser": "^0.1.17", "grunt-karma": "^0.8.3", "grunt-s3": "~0.2.0-alpha", - "grunt-tagrelease": "~0.3.3", "grunt-version": "~0.3.0", "grunt-videojs-languages": "0.0.4", "grunt-zip": "0.10.2", From 972c8bd744d3ba5008777c197ba37a52bf4bbb20 Mon Sep 17 00:00:00 2001 From: Matthew McClure Date: Thu, 26 Feb 2015 15:52:10 -0800 Subject: [PATCH 5/6] manually tag before github-release --- contrib.json | 49 +++++++++++++++++++++++++------------------------ 1 file changed, 25 insertions(+), 24 deletions(-) diff --git a/contrib.json b/contrib.json index 455c4fcca..833bc1089 100644 --- a/contrib.json +++ b/contrib.json @@ -198,30 +198,31 @@ "run": { "steps": [ { "include": "branch check" }, - [ "git checkout stable", "Checkout the release branch" ], - [ "git pull upstream stable", "Update the release branch" ], - [ "npm install", "Ensure dependency updates have been installed" ], - [ "grunt test", "Run tests" ], - [ "grunt version:{{ release_type }}", "Bump package versions" ], - [ "grunt vjs-version", "Return the current VJS Version from the package.json file", "version" ], - [ "grunt chg-release:{{ version }}", "Update the changelog with the new release" ], - [ "grunt clean:dist", "Clean out the dist folder before the build" ], - [ "grunt", "Build the release" ], - [ "git add dist/video-js --force", "Add the (otherwise ignored) release files" ], - [ "grunt vjsdocs", "Rebuild the docs" ], - [ "grunt cdn-links", "Update the cdn urls in the docs" ], - [ "git commit -am 'Release v{{ version }}'", "Commit the unstaged changes (package.json, changelog, etc)" ], - [ "git push upstream stable", "Push changes to the remote" ], - [ "git push upstream --tags", "Push tags to the remote" ], - [ "npm publish", "Publish to npm" ], - [ "grunt github-release", "Create a new release on Github"], - [ "git checkout master", "Checkout the development branch" ], - [ "git pull upstream master", "Update the development branch" ], - [ "git merge stable", "Merge changes" ], - [ "grunt clean:dist", "Remove built dist files again to re-ignore them" ], - [ "git add -u", "Add the changes for the removed dist files" ], - [ "git commit -m 'Removed dist files'", "Commit the removed dist files" ], - [ "git push upstream master", "Push development branch changes" ] + [ "git checkout stable", "Checkout the release branch" ], + [ "git pull upstream stable", "Update the release branch" ], + [ "npm install", "Ensure dependency updates have been installed" ], + [ "grunt test", "Run tests" ], + [ "grunt version:{{ release_type }}", "Bump package versions" ], + [ "grunt vjs-version", "Return the current VJS Version from the package.json file", "version" ], + [ "grunt chg-release:{{ version }}", "Update the changelog with the new release" ], + [ "grunt clean:dist", "Clean out the dist folder before the build" ], + [ "grunt", "Build the release" ], + [ "git add dist/video-js --force", "Add the (otherwise ignored) release files" ], + [ "grunt vjsdocs", "Rebuild the docs" ], + [ "grunt cdn-links", "Update the cdn urls in the docs" ], + [ "git commit -am 'Release v{{ version }}'", "Commit the unstaged changes (package.json, changelog, etc)" ], + [ "git tag -a v{{version}} -m 'v{{version}}'", "Tag the current version" ], + [ "git push upstream stable", "Push changes to the remote" ], + [ "git push upstream --tags", "Push tags to the remote" ], + [ "npm publish", "Publish to npm" ], + [ "grunt github-release", "Create a new release on Github" ], + [ "git checkout master", "Checkout the development branch" ], + [ "git pull upstream master", "Update the development branch" ], + [ "git merge stable", "Merge changes" ], + [ "grunt clean:dist", "Remove built dist files again to re-ignore them" ], + [ "git add -u", "Add the changes for the removed dist files" ], + [ "git commit -m 'Removed dist files'", "Commit the removed dist files" ], + [ "git push upstream master", "Push development branch changes" ] ] } }, From ed8ccf599bc7d7ac2834f26b9d081a5d8106783a Mon Sep 17 00:00:00 2001 From: Matthew Date: Fri, 27 Feb 2015 00:09:30 +0000 Subject: [PATCH 6/6] Release v4.12.2 --- CHANGELOG.md | 5 +++- bower.json | 2 +- component.json | 2 +- dist/video-js/lang/zh.js | 27 ------------------ dist/video-js/video-js.css | 2 +- dist/video-js/video-js.min.css | 2 +- dist/video-js/video.dev.js | 9 +++--- dist/video-js/video.js | 48 ++++++++++++++++---------------- dist/video-js/video.novtt.dev.js | 9 +++--- dist/video-js/video.novtt.js | 46 +++++++++++++++--------------- docs/api/vjs.Html5.md | 10 +++---- package.json | 2 +- 12 files changed, 71 insertions(+), 93 deletions(-) delete mode 100644 dist/video-js/lang/zh.js diff --git a/CHANGELOG.md b/CHANGELOG.md index 43175d424..34962fed0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,10 +2,13 @@ CHANGELOG ========= ## HEAD (Unreleased) -* @gkatsev fixed disabling of default text tracks ([view](https://github.com/videojs/video.js/pull/1892)) +_(none)_ -------------------- +## 4.12.2 (2015-02-27) +* @gkatsev fixed disabling of default text tracks ([view](https://github.com/videojs/video.js/pull/1892)) + ## 4.12.1 (2015-02-19) * @gkatsev fixed the track list reference while switching techs that use emulated tracks ([view](https://github.com/videojs/video.js/pull/1874)) * @gkatsev fixed a Firefox error with the captions settings select menu options ([view](https://github.com/videojs/video.js/pull/1877)) diff --git a/bower.json b/bower.json index fbc2c7494..deab65139 100644 --- a/bower.json +++ b/bower.json @@ -1,7 +1,7 @@ { "name": "video.js", "description": "An HTML5 and Flash video player with a common API and skin for both.", - "version": "4.12.1", + "version": "4.12.2", "main": [ "dist/video-js/video.js", "dist/video-js/video-js.css", diff --git a/component.json b/component.json index 2c59b2d2d..c530e115b 100644 --- a/component.json +++ b/component.json @@ -1,7 +1,7 @@ { "name": "video.js", "description": "An HTML5 and Flash video player with a common API and skin for both.", - "version": "4.12.1", + "version": "4.12.2", "keywords": [ "videojs", "html5", diff --git a/dist/video-js/lang/zh.js b/dist/video-js/lang/zh.js deleted file mode 100644 index 604cf9edd..000000000 --- a/dist/video-js/lang/zh.js +++ /dev/null @@ -1,27 +0,0 @@ -videojs.addLanguage("zh",{ - "Play": "播放", - "Pause": "暂停", - "Current Time": "当前时间", - "Duration Time": "时长", - "Remaining Time": "剩余时间", - "Stream Type": "媒体流类型", - "LIVE": "直播", - "Loaded": "加载完毕", - "Progress": "进度", - "Fullscreen": "全屏", - "Non-Fullscreen": "退出全屏", - "Mute": "静音", - "Unmuted": "取消静音", - "Playback Rate": "播放码率", - "Subtitles": "字幕", - "subtitles off": "字幕关闭", - "Captions": "内嵌字幕", - "captions off": "内嵌字幕关闭", - "Chapters": "节目段落", - "You aborted the video playback": "视频播放被终止", - "A network error caused the video download to fail part-way.": "网络错误导致视频下载中途失败。", - "The video could not be loaded, either because the server or network failed or because the format is not supported.": "视频因格式不支持或者服务器或网络的问题无法加载。", - "The video playback was aborted due to a corruption problem or because the video used features your browser did not support.": "由于视频文件损坏或是该视频使用了你的浏览器不支持的功能,播放终止。", - "No compatible source was found for this video.": "无法找到此视频兼容的源。", - "The video is encrypted and we do not have the keys to decrypt it.": "视频已加密,无法解密。" -}); \ No newline at end of file diff --git a/dist/video-js/video-js.css b/dist/video-js/video-js.css index 24dbd7374..591043911 100644 --- a/dist/video-js/video-js.css +++ b/dist/video-js/video-js.css @@ -1,6 +1,6 @@ /*! Video.js Default Styles (http://videojs.com) -Version 4.12.1 +Version 4.12.2 Create your own skin at http://designer.videojs.com */ /* SKIN diff --git a/dist/video-js/video-js.min.css b/dist/video-js/video-js.min.css index 2ac694957..8190c6711 100644 --- a/dist/video-js/video-js.min.css +++ b/dist/video-js/video-js.min.css @@ -1,5 +1,5 @@ /*! Video.js Default Styles (http://videojs.com) -Version 4.12.1 +Version 4.12.2 Create your own skin at http://designer.videojs.com */.vjs-default-skin{color:#ccc}@font-face{font-family:VideoJS;src:url(font/vjs.eot);src:url(font/vjs.eot?#iefix) format('embedded-opentype'),url(font/vjs.woff) format('woff'),url(font/vjs.ttf) format('truetype'),url(font/vjs.svg#icomoon) format('svg');font-weight:400;font-style:normal}.vjs-default-skin .vjs-slider{outline:0;position:relative;cursor:pointer;padding:0;background-color:#333;background-color:rgba(51,51,51,.9)}.vjs-default-skin .vjs-slider:focus{-webkit-box-shadow:0 0 2em #fff;-moz-box-shadow:0 0 2em #fff;box-shadow:0 0 2em #fff}.vjs-default-skin .vjs-slider-handle{position:absolute;left:0;top:0}.vjs-default-skin .vjs-slider-handle:before{content:"\e009";font-family:VideoJS;font-size:1em;line-height:1;text-align:center;text-shadow:0 0 1em #fff;position:absolute;top:0;left:0;-webkit-transform:rotate(-45deg);-moz-transform:rotate(-45deg);-ms-transform:rotate(-45deg);-o-transform:rotate(-45deg);transform:rotate(-45deg)}.vjs-default-skin .vjs-control-bar{display:none;position:absolute;bottom:0;left:0;right:0;height:3em;background-color:#07141e;background-color:rgba(7,20,30,.7)}.vjs-default-skin.vjs-has-started .vjs-control-bar{display:block;visibility:visible;opacity:1;-webkit-transition:visibility .1s,opacity .1s;-moz-transition:visibility .1s,opacity .1s;-o-transition:visibility .1s,opacity .1s;transition:visibility .1s,opacity .1s}.vjs-default-skin.vjs-has-started.vjs-user-inactive.vjs-playing .vjs-control-bar{display:block;visibility:hidden;opacity:0;-webkit-transition:visibility 1s,opacity 1s;-moz-transition:visibility 1s,opacity 1s;-o-transition:visibility 1s,opacity 1s;transition:visibility 1s,opacity 1s}.vjs-default-skin.vjs-controls-disabled .vjs-control-bar{display:none}.vjs-default-skin.vjs-using-native-controls .vjs-control-bar{display:none}.vjs-default-skin.vjs-error .vjs-control-bar{display:none}.vjs-audio.vjs-default-skin.vjs-has-started.vjs-user-inactive.vjs-playing .vjs-control-bar{opacity:1;visibility:visible}@media \0screen{.vjs-default-skin.vjs-user-inactive.vjs-playing .vjs-control-bar :before{content:""}}.vjs-default-skin .vjs-control{outline:0;position:relative;float:left;text-align:center;margin:0;padding:0;height:3em;width:4em}.vjs-default-skin .vjs-control:before{font-family:VideoJS;font-size:1.5em;line-height:2;position:absolute;top:0;left:0;width:100%;height:100%;text-align:center;text-shadow:1px 1px 1px rgba(0,0,0,.5)}.vjs-default-skin .vjs-control:focus:before,.vjs-default-skin .vjs-control:hover:before{text-shadow:0 0 1em #fff}.vjs-default-skin .vjs-control:focus{}.vjs-default-skin .vjs-control-text{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px}.vjs-default-skin .vjs-play-control{width:5em;cursor:pointer}.vjs-default-skin .vjs-play-control:before{content:"\e001"}.vjs-default-skin.vjs-playing .vjs-play-control:before{content:"\e002"}.vjs-default-skin .vjs-playback-rate .vjs-playback-rate-value{font-size:1.5em;line-height:2;position:absolute;top:0;left:0;width:100%;height:100%;text-align:center;text-shadow:1px 1px 1px rgba(0,0,0,.5)}.vjs-default-skin .vjs-playback-rate.vjs-menu-button .vjs-menu .vjs-menu-content{width:4em;left:-2em;list-style:none}.vjs-default-skin .vjs-mute-control,.vjs-default-skin .vjs-volume-menu-button{cursor:pointer;float:right}.vjs-default-skin .vjs-mute-control:before,.vjs-default-skin .vjs-volume-menu-button:before{content:"\e006"}.vjs-default-skin .vjs-mute-control.vjs-vol-0:before,.vjs-default-skin .vjs-volume-menu-button.vjs-vol-0:before{content:"\e003"}.vjs-default-skin .vjs-mute-control.vjs-vol-1:before,.vjs-default-skin .vjs-volume-menu-button.vjs-vol-1:before{content:"\e004"}.vjs-default-skin .vjs-mute-control.vjs-vol-2:before,.vjs-default-skin .vjs-volume-menu-button.vjs-vol-2:before{content:"\e005"}.vjs-default-skin .vjs-volume-control{width:5em;float:right}.vjs-default-skin .vjs-volume-bar{width:5em;height:.6em;margin:1.1em auto 0}.vjs-default-skin .vjs-volume-level{position:absolute;top:0;left:0;height:.5em;width:100%;background:#66a8cc url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAYAAAAGCAYAAADgzO9IAAAAP0lEQVQIHWWMAQoAIAgDR/QJ/Ub//04+w7ZICBwcOg5FZi5iBB82AGzixEglJrd4TVK5XUJpskSTEvpdFzX9AB2pGziSQcvAAAAAAElFTkSuQmCC) -50% 0 repeat}.vjs-default-skin .vjs-volume-bar .vjs-volume-handle{width:.5em;height:.5em;left:4.5em}.vjs-default-skin .vjs-volume-handle:before{font-size:.9em;top:-.2em;left:-.2em;width:1em;height:1em}.vjs-default-skin .vjs-volume-menu-button .vjs-menu{display:block;width:0;height:0;border-top-color:transparent}.vjs-default-skin .vjs-volume-menu-button .vjs-menu .vjs-menu-content{height:0;width:0}.vjs-default-skin .vjs-volume-menu-button:hover .vjs-menu,.vjs-default-skin .vjs-volume-menu-button .vjs-menu.vjs-lock-showing{border-top-color:rgba(7,40,50,.5)}.vjs-default-skin .vjs-volume-menu-button:hover .vjs-menu .vjs-menu-content,.vjs-default-skin .vjs-volume-menu-button .vjs-menu.vjs-lock-showing .vjs-menu-content{height:2.9em;width:10em}.vjs-default-skin .vjs-progress-control{position:absolute;left:0;right:0;width:auto;font-size:.3em;height:1em;top:-1em;-webkit-transition:all .4s;-moz-transition:all .4s;-o-transition:all .4s;transition:all .4s}.vjs-default-skin:hover .vjs-progress-control{font-size:.9em;-webkit-transition:all .2s;-moz-transition:all .2s;-o-transition:all .2s;transition:all .2s}.vjs-default-skin .vjs-progress-holder{height:100%}.vjs-default-skin .vjs-progress-holder .vjs-play-progress,.vjs-default-skin .vjs-progress-holder .vjs-load-progress,.vjs-default-skin .vjs-progress-holder .vjs-load-progress div{position:absolute;display:block;height:100%;margin:0;padding:0;width:0;left:0;top:0}.vjs-default-skin .vjs-play-progress{background:#66a8cc url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAYAAAAGCAYAAADgzO9IAAAAP0lEQVQIHWWMAQoAIAgDR/QJ/Ub//04+w7ZICBwcOg5FZi5iBB82AGzixEglJrd4TVK5XUJpskSTEvpdFzX9AB2pGziSQcvAAAAAAElFTkSuQmCC) -50% 0 repeat}.vjs-default-skin .vjs-load-progress{background:#646464;background:rgba(255,255,255,.2)}.vjs-default-skin .vjs-load-progress div{background:#787878;background:rgba(255,255,255,.1)}.vjs-default-skin .vjs-seek-handle{width:1.5em;height:100%}.vjs-default-skin .vjs-seek-handle:before{padding-top:.1em}.vjs-default-skin.vjs-live .vjs-time-controls,.vjs-default-skin.vjs-live .vjs-time-divider,.vjs-default-skin.vjs-live .vjs-progress-control{display:none}.vjs-default-skin.vjs-live .vjs-live-display{display:block}.vjs-default-skin .vjs-live-display{display:none;font-size:1em;line-height:3em}.vjs-default-skin .vjs-time-controls{font-size:1em;line-height:3em}.vjs-default-skin .vjs-current-time{float:left}.vjs-default-skin .vjs-duration{float:left}.vjs-default-skin .vjs-remaining-time{display:none;float:left}.vjs-time-divider{float:left;line-height:3em}.vjs-default-skin .vjs-fullscreen-control{width:3.8em;cursor:pointer;float:right}.vjs-default-skin .vjs-fullscreen-control:before{content:"\e000"}.vjs-default-skin.vjs-fullscreen .vjs-fullscreen-control:before{content:"\e00b"}.vjs-default-skin .vjs-big-play-button{left:.5em;top:.5em;font-size:3em;display:block;z-index:2;position:absolute;width:4em;height:2.6em;text-align:center;vertical-align:middle;cursor:pointer;opacity:1;background-color:#07141e;background-color:rgba(7,20,30,.7);border:.1em solid #3b4249;-webkit-border-radius:.8em;-moz-border-radius:.8em;border-radius:.8em;-webkit-box-shadow:0 0 1em rgba(255,255,255,.25);-moz-box-shadow:0 0 1em rgba(255,255,255,.25);box-shadow:0 0 1em rgba(255,255,255,.25);-webkit-transition:all .4s;-moz-transition:all .4s;-o-transition:all .4s;transition:all .4s}.vjs-default-skin.vjs-big-play-centered .vjs-big-play-button{left:50%;margin-left:-2.1em;top:50%;margin-top:-1.4000000000000001em}.vjs-default-skin.vjs-controls-disabled .vjs-big-play-button{display:none}.vjs-default-skin.vjs-has-started .vjs-big-play-button{display:none}.vjs-default-skin.vjs-using-native-controls .vjs-big-play-button{display:none}.vjs-default-skin:hover .vjs-big-play-button,.vjs-default-skin .vjs-big-play-button:focus{outline:0;border-color:#fff;background-color:#505050;background-color:rgba(50,50,50,.75);-webkit-box-shadow:0 0 3em #fff;-moz-box-shadow:0 0 3em #fff;box-shadow:0 0 3em #fff;-webkit-transition:all 0s;-moz-transition:all 0s;-o-transition:all 0s;transition:all 0s}.vjs-default-skin .vjs-big-play-button:before{content:"\e001";font-family:VideoJS;line-height:2.6em;text-shadow:.05em .05em .1em #000;text-align:center;position:absolute;left:0;width:100%;height:100%}.vjs-error .vjs-big-play-button{display:none}.vjs-error-display{display:none}.vjs-error .vjs-error-display{display:block;position:absolute;left:0;top:0;width:100%;height:100%}.vjs-error .vjs-error-display:before{content:'X';font-family:Arial;font-size:4em;color:#666;line-height:1;text-shadow:.05em .05em .1em #000;text-align:center;vertical-align:middle;position:absolute;left:0;top:50%;margin-top:-.5em;width:100%}.vjs-error-display div{position:absolute;bottom:1em;right:0;left:0;font-size:1.4em;text-align:center;padding:3px;background:#000;background:rgba(0,0,0,.5)}.vjs-error-display a,.vjs-error-display a:visited{color:#F4A460}.vjs-loading-spinner{display:none;position:absolute;top:50%;left:50%;font-size:4em;line-height:1;width:1em;height:1em;margin-left:-.5em;margin-top:-.5em;opacity:.75}.vjs-waiting .vjs-loading-spinner,.vjs-seeking .vjs-loading-spinner{display:block;-webkit-animation:spin 1.5s infinite linear;-moz-animation:spin 1.5s infinite linear;-o-animation:spin 1.5s infinite linear;animation:spin 1.5s infinite linear}.vjs-error .vjs-loading-spinner{display:none;-webkit-animation:none;-moz-animation:none;-o-animation:none;animation:none}.vjs-default-skin .vjs-loading-spinner:before{content:"\e01e";font-family:VideoJS;position:absolute;top:0;left:0;width:1em;height:1em;text-align:center;text-shadow:0 0 .1em #000}@-moz-keyframes spin{0%{-moz-transform:rotate(0deg)}100%{-moz-transform:rotate(359deg)}}@-webkit-keyframes spin{0%{-webkit-transform:rotate(0deg)}100%{-webkit-transform:rotate(359deg)}}@-o-keyframes spin{0%{-o-transform:rotate(0deg)}100%{-o-transform:rotate(359deg)}}@keyframes spin{0%{transform:rotate(0deg)}100%{transform:rotate(359deg)}}.vjs-default-skin .vjs-menu-button{float:right;cursor:pointer}.vjs-default-skin .vjs-menu{display:none;position:absolute;bottom:0;left:0;width:0;height:0;margin-bottom:3em;border-left:2em solid transparent;border-right:2em solid transparent;border-top:1.55em solid #000;border-top-color:rgba(7,40,50,.5)}.vjs-default-skin .vjs-menu-button .vjs-menu .vjs-menu-content{display:block;padding:0;margin:0;position:absolute;width:10em;bottom:1.5em;max-height:15em;overflow:auto;left:-5em;background-color:#07141e;background-color:rgba(7,20,30,.7);-webkit-box-shadow:-.2em -.2em .3em rgba(255,255,255,.2);-moz-box-shadow:-.2em -.2em .3em rgba(255,255,255,.2);box-shadow:-.2em -.2em .3em rgba(255,255,255,.2)}.vjs-default-skin .vjs-menu-button:hover .vjs-control-content .vjs-menu,.vjs-default-skin .vjs-control-content .vjs-menu.vjs-lock-showing{display:block}.vjs-default-skin.vjs-scrubbing .vjs-menu-button:hover .vjs-control-content .vjs-menu{display:none}.vjs-default-skin .vjs-menu-button ul li{list-style:none;margin:0;padding:.3em 0;line-height:1.4em;font-size:1.2em;text-align:center;text-transform:lowercase}.vjs-default-skin .vjs-menu-button ul li.vjs-selected{background-color:#000}.vjs-default-skin .vjs-menu-button ul li:focus,.vjs-default-skin .vjs-menu-button ul li:hover,.vjs-default-skin .vjs-menu-button ul li.vjs-selected:focus,.vjs-default-skin .vjs-menu-button ul li.vjs-selected:hover{outline:0;color:#111;background-color:#fff;background-color:rgba(255,255,255,.75);-webkit-box-shadow:0 0 1em #fff;-moz-box-shadow:0 0 1em #fff;box-shadow:0 0 1em #fff}.vjs-default-skin .vjs-menu-button ul li.vjs-menu-title{text-align:center;text-transform:uppercase;font-size:1em;line-height:2em;padding:0;margin:0 0 .3em;font-weight:700;cursor:default}.vjs-default-skin .vjs-subtitles-button:before{content:"\e00c"}.vjs-default-skin .vjs-captions-button:before{content:"\e008"}.vjs-default-skin .vjs-chapters-button:before{content:"\e00c"}.vjs-default-skin .vjs-chapters-button.vjs-menu-button .vjs-menu .vjs-menu-content{width:24em;left:-12em}.vjs-default-skin .vjs-captions-button:focus .vjs-control-content:before,.vjs-default-skin .vjs-captions-button:hover .vjs-control-content:before{-webkit-box-shadow:0 0 1em #fff;-moz-box-shadow:0 0 1em #fff;box-shadow:0 0 1em #fff}.video-js{background-color:#000;position:relative;padding:0;font-size:10px;vertical-align:middle;font-weight:400;font-style:normal;font-family:Arial,sans-serif;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.video-js .vjs-tech{position:absolute;top:0;left:0;width:100%;height:100%}.video-js:-moz-full-screen{position:absolute}body.vjs-full-window{padding:0;margin:0;height:100%;overflow-y:auto}.video-js.vjs-fullscreen{position:fixed;overflow:hidden;z-index:1000;left:0;top:0;bottom:0;right:0;width:100%!important;height:100%!important;_position:absolute}.video-js:-webkit-full-screen{width:100%!important;height:100%!important}.video-js.vjs-fullscreen.vjs-user-inactive{cursor:none}.vjs-poster{background-repeat:no-repeat;background-position:50% 50%;background-size:contain;cursor:pointer;margin:0;padding:0;position:absolute;top:0;right:0;bottom:0;left:0}.vjs-poster img{display:block;margin:0 auto;max-height:100%;padding:0;width:100%}.video-js.vjs-has-started .vjs-poster{display:none}.video-js.vjs-audio.vjs-has-started .vjs-poster{display:block}.video-js.vjs-controls-disabled .vjs-poster{display:none}.video-js.vjs-using-native-controls .vjs-poster{display:none}.video-js .vjs-text-track-display{position:absolute;top:0;left:0;bottom:3em;right:0;pointer-events:none}.vjs-caption-settings{position:relative;top:1em;background-color:#000;opacity:.75;color:#FFF;margin:0 auto;padding:.5em;height:15em;font-family:Arial,Helvetica,sans-serif;font-size:12px;width:40em}.vjs-caption-settings .vjs-tracksettings{top:0;bottom:2em;left:0;right:0;position:absolute;overflow:auto}.vjs-caption-settings .vjs-tracksettings-colors,.vjs-caption-settings .vjs-tracksettings-font{float:left}.vjs-caption-settings .vjs-tracksettings-colors:after,.vjs-caption-settings .vjs-tracksettings-font:after,.vjs-caption-settings .vjs-tracksettings-controls:after{clear:both}.vjs-caption-settings .vjs-tracksettings-controls{position:absolute;bottom:1em;right:1em}.vjs-caption-settings .vjs-tracksetting{margin:5px;padding:3px;min-height:40px}.vjs-caption-settings .vjs-tracksetting label{display:block;width:100px;margin-bottom:5px}.vjs-caption-settings .vjs-tracksetting span{display:inline;margin-left:5px}.vjs-caption-settings .vjs-tracksetting>div{margin-bottom:5px;min-height:20px}.vjs-caption-settings .vjs-tracksetting>div:last-child{margin-bottom:0;padding-bottom:0;min-height:0}.vjs-caption-settings label>input{margin-right:10px}.vjs-caption-settings input[type=button]{width:40px;height:40px}.vjs-hidden{display:none!important}.vjs-lock-showing{display:block!important;opacity:1;visibility:visible}.vjs-no-js{padding:2em;color:#ccc;background-color:#333;font-size:1.8em;font-family:Arial,sans-serif;text-align:center;width:30em;height:15em;margin:0 auto}.vjs-no-js a,.vjs-no-js a:visited{color:#F4A460} \ No newline at end of file diff --git a/dist/video-js/video.dev.js b/dist/video-js/video.dev.js index f14d53ddc..acb6c43c1 100644 --- a/dist/video-js/video.dev.js +++ b/dist/video-js/video.dev.js @@ -80,7 +80,7 @@ vjs.ACCESS_PROTOCOL = ('https:' == document.location.protocol ? 'https://' : 'ht * Full player version * @type {string} */ -vjs['VERSION'] = '4.12.1'; +vjs['VERSION'] = '4.12.2'; /** * Global Player instance options, surfaced from vjs.Player.prototype.options_ @@ -7223,7 +7223,7 @@ vjs.Html5.prototype.createEl = function(){ vjs.Html5.prototype.hideCaptions = function() { - var tracks = this.el_.textTracks, + var tracks = this.el_.querySelectorAll('track'), track, i = tracks.length, kinds = { @@ -7232,8 +7232,9 @@ vjs.Html5.prototype.hideCaptions = function() { }; while (i--) { - track = tracks[i]; - if (track && track['kind'] in kinds) { + track = tracks[i].track; + if ((track && track['kind'] in kinds) && + (!tracks[i]['default'])) { track.mode = 'disabled'; } } diff --git a/dist/video-js/video.js b/dist/video-js/video.js index 1f376bf38..b17bf8025 100644 --- a/dist/video-js/video.js +++ b/dist/video-js/video.js @@ -1,6 +1,6 @@ -/*! Video.js v4.12.1 Copyright 2014 Brightcove, Inc. https://github.com/videojs/video.js/blob/master/LICENSE */ +/*! Video.js v4.12.2 Copyright 2014 Brightcove, Inc. https://github.com/videojs/video.js/blob/master/LICENSE */ (function() {var b=void 0,f=!0,j=null,l=!1;function m(){return function(){}}function n(a){return function(){return this[a]}}function q(a){return function(){return a}}var s;document.createElement("video");document.createElement("audio");document.createElement("track"); -function t(a,c,d){if("string"===typeof a){0===a.indexOf("#")&&(a=a.slice(1));if(t.Aa[a])return c&&t.log.warn('Player "'+a+'" is already initialised. Options will not be applied.'),d&&t.Aa[a].I(d),t.Aa[a];a=t.m(a)}if(!a||!a.nodeName)throw new TypeError("The element or ID supplied is not valid. (videojs)");return a.player||new t.Player(a,c,d)}var videojs=window.videojs=t;t.ic="4.12";t.vd="https:"==document.location.protocol?"https://":"http://";t.VERSION="4.12.1"; +function t(a,c,d){if("string"===typeof a){0===a.indexOf("#")&&(a=a.slice(1));if(t.Aa[a])return c&&t.log.warn('Player "'+a+'" is already initialised. Options will not be applied.'),d&&t.Aa[a].I(d),t.Aa[a];a=t.m(a)}if(!a||!a.nodeName)throw new TypeError("The element or ID supplied is not valid. (videojs)");return a.player||new t.Player(a,c,d)}var videojs=window.videojs=t;t.ic="4.12";t.vd="https:"==document.location.protocol?"https://":"http://";t.VERSION="4.12.2"; t.options={techOrder:["html5","flash"],html5:{},flash:{},width:300,height:150,defaultVolume:0,playbackRates:[],inactivityTimeout:2E3,children:{mediaLoader:{},posterImage:{},loadingSpinner:{},textTrackDisplay:{},bigPlayButton:{},controlBar:{},errorDisplay:{},textTrackSettings:{}},language:document.getElementsByTagName("html")[0].getAttribute("lang")||navigator.languages&&navigator.languages[0]||navigator.If||navigator.language||"en",languages:{},notSupportedMessage:"No compatible source was found for this video."}; "GENERATED_CDN_VSN"!==t.ic&&(videojs.options.flash.swf=t.vd+"vjs.zencdn.net/"+t.ic+"/video-js.swf");t.Jd=function(a,c){t.options.languages[a]=t.options.languages[a]!==b?t.$.ya(t.options.languages[a],c):c;return t.options.languages};t.Aa={};"function"===typeof define&&define.amd?define("videojs",[],function(){return videojs}):"object"===typeof exports&&"object"===typeof module&&(module.exports=videojs);t.Ea=t.CoreObject=m(); t.Ea.extend=function(a){var c,d;a=a||{};c=a.init||a.l||this.prototype.init||this.prototype.l||m();d=function(){c.apply(this,arguments)};d.prototype=t.i.create(this.prototype);d.prototype.constructor=d;d.extend=t.Ea.extend;d.create=t.Ea.create;for(var e in a)a.hasOwnProperty(e)&&(d.prototype[e]=a[e]);return d};t.Ea.create=function(){var a=t.i.create(this.prototype);this.apply(a,arguments);return a}; @@ -31,7 +31,7 @@ e),this.b("touchend",a),this.b("touchcancel",a))}}});s=t.a.prototype;s.dispose=f s.v=function(a){var c=this.d.language(),d=this.d.languages();return d&&d[c]&&d[c][a]?d[c][a]:a};s.m=n("c");s.va=function(){return this.B||this.c};s.id=n("Pa");s.name=n("te");s.children=n("R");s.ae=function(a){return this.fb[a]};s.ea=function(a){return this.gb[a]}; s.ba=function(a,c){var d,e;"string"===typeof a?(e=a,c=c||{},d=c.componentClass||t.ua(e),c.name=e,d=new window.videojs[d](this.d||this,c)):d=a;this.R.push(d);"function"===typeof d.id&&(this.fb[d.id()]=d);(e=e||d.name&&d.name())&&(this.gb[e]=d);"function"===typeof d.el&&d.el()&&this.va().appendChild(d.el());return d}; s.removeChild=function(a){"string"===typeof a&&(a=this.ea(a));if(a&&this.R){for(var c=l,d=this.R.length-1;0<=d;d--)if(this.R[d]===a){c=f;this.R.splice(d,1);break}c&&(this.fb[a.id()]=j,this.gb[a.name()]=j,(c=a.m())&&c.parentNode===this.va()&&this.va().removeChild(a.m()))}}; -s.Oc=function(){var a,c,d,e,g,h;a=this;c=a.options();if(d=c.children)if(h=function(d,e){c[d]!==b&&(e=c[d]);e!==l&&(a[d]=a.ba(d,e))},t.i.isArray(d))for(var k=0;ke&&(a.preventDefault(),this.o("tap")))})} s.setTimeout=function(a,c){function d(){this.clearTimeout(e)}a=t.bind(this,a);var e=setTimeout(a,c);d.s="vjs-timeout-"+e;this.b("dispose",d);return e};s.clearTimeout=function(a){function c(){}clearTimeout(a);c.s="vjs-timeout-"+a;this.n("dispose",c);return a};s.setInterval=function(a,c){function d(){this.clearInterval(e)}a=t.bind(this,a);var e=setInterval(a,c);d.s="vjs-interval-"+e;this.b("dispose",d);return e}; s.clearInterval=function(a){function c(){}clearInterval(a);c.s="vjs-interval-"+a;this.n("dispose",c);return a};t.w=t.a.extend({l:function(a,c){t.a.call(this,a,c);da(this);this.b("tap",this.u);this.b("click",this.u);this.b("focus",this.lb);this.b("blur",this.kb)}});s=t.w.prototype; -s.e=function(a,c){var d;c=t.i.D({className:this.T(),role:"button","aria-live":"polite",tabIndex:0},c);d=t.a.prototype.e.call(this,a,c);c.innerHTML||(this.B=t.e("div",{className:"vjs-control-content"}),this.Jb=t.e("span",{className:"vjs-control-text",innerHTML:this.v(this.sa)||"Need Text"}),this.B.appendChild(this.Jb),d.appendChild(this.B));return d};s.T=function(){return"vjs-control "+t.a.prototype.T.call(this)};s.u=m();s.lb=function(){t.b(document,"keydown",t.bind(this,this.ja))}; -s.ja=function(a){if(32==a.which||13==a.which)a.preventDefault(),this.u()};s.kb=function(){t.n(document,"keydown",t.bind(this,this.ja))};t.S=t.a.extend({l:function(a,c){t.a.call(this,a,c);this.Kd=this.ea(this.q.barName);this.handle=this.ea(this.q.handleName);this.b("mousedown",this.mb);this.b("touchstart",this.mb);this.b("focus",this.lb);this.b("blur",this.kb);this.b("click",this.u);this.b(a,"controlsvisible",this.update);this.b(a,this.Yc,this.update)}});s=t.S.prototype; +s.e=function(a,c){var d;c=t.i.D({className:this.U(),role:"button","aria-live":"polite",tabIndex:0},c);d=t.a.prototype.e.call(this,a,c);c.innerHTML||(this.B=t.e("div",{className:"vjs-control-content"}),this.Jb=t.e("span",{className:"vjs-control-text",innerHTML:this.v(this.sa)||"Need Text"}),this.B.appendChild(this.Jb),d.appendChild(this.B));return d};s.U=function(){return"vjs-control "+t.a.prototype.U.call(this)};s.u=m();s.lb=function(){t.b(document,"keydown",t.bind(this,this.ja))}; +s.ja=function(a){if(32==a.which||13==a.which)a.preventDefault(),this.u()};s.kb=function(){t.n(document,"keydown",t.bind(this,this.ja))};t.T=t.a.extend({l:function(a,c){t.a.call(this,a,c);this.Kd=this.ea(this.q.barName);this.handle=this.ea(this.q.handleName);this.b("mousedown",this.mb);this.b("touchstart",this.mb);this.b("focus",this.lb);this.b("blur",this.kb);this.b("click",this.u);this.b(a,"controlsvisible",this.update);this.b(a,this.Yc,this.update)}});s=t.T.prototype; s.e=function(a,c){c=c||{};c.className+=" vjs-slider";c=t.i.D({role:"slider","aria-valuenow":0,"aria-valuemin":0,"aria-valuemax":100,tabIndex:0},c);return t.a.prototype.e.call(this,a,c)};s.mb=function(a){a.preventDefault();t.Ld();this.p("vjs-sliding");this.b(document,"mousemove",this.ka);this.b(document,"mouseup",this.za);this.b(document,"touchmove",this.ka);this.b(document,"touchend",this.za);this.ka(a)};s.ka=m(); s.za=function(){t.af();this.r("vjs-sliding");this.n(document,"mousemove",this.ka);this.n(document,"mouseup",this.za);this.n(document,"touchmove",this.ka);this.n(document,"touchend",this.za);this.update()};s.update=function(){if(this.c){var a,c=this.Sb(),d=this.handle,e=this.Kd;if("number"!==typeof c||c!==c||0>c||Infinity===c)c=0;a=c;if(d){a=this.c.offsetWidth;var g=d.m().offsetWidth;a=g?g/a:0;c*=1-a;a=c+a/2;d.m().style.left=t.round(100*c,2)+"%"}e&&(e.m().style.width=t.round(100*a,2)+"%")}}; function ea(a,c){var d,e,g,h;d=a.c;e=t.Yd(d);h=g=d.offsetWidth;d=a.handle;if(a.options().vertical)return h=e.top,e=c.changedTouches?c.changedTouches[0].pageY:c.pageY,d&&(d=d.m().offsetHeight,h+=d/2,g-=d),Math.max(0,Math.min(1,(h-e+g)/g));g=e.left;e=c.changedTouches?c.changedTouches[0].pageX:c.pageX;d&&(d=d.m().offsetWidth,g+=d/2,h-=d);return Math.max(0,Math.min(1,(e-g)/h))}s.lb=function(){this.b(document,"keydown",this.ja)}; @@ -48,7 +48,7 @@ s.ja=function(a){if(37==a.which||40==a.which)a.preventDefault(),this.jd();else i t.pa=t.a.extend();function fa(a,c){a.ba(c);c.b("click",t.bind(a,function(){G(this)}))}t.pa.prototype.e=function(){var a=this.options().Cc||"ul";this.B=t.e(a,{className:"vjs-menu-content"});a=t.a.prototype.e.call(this,"div",{append:this.B,className:"vjs-menu"});a.appendChild(this.B);t.b(a,"click",function(a){a.preventDefault();a.stopImmediatePropagation()});return a};t.M=t.w.extend({l:function(a,c){t.w.call(this,a,c);this.selected(c.selected)}}); t.M.prototype.e=function(a,c){return t.w.prototype.e.call(this,"li",t.i.D({className:"vjs-menu-item",innerHTML:this.v(this.q.label)},c))};t.M.prototype.u=function(){this.selected(f)};t.M.prototype.selected=function(a){a?(this.p("vjs-selected"),this.c.setAttribute("aria-selected",f)):(this.r("vjs-selected"),this.c.setAttribute("aria-selected",l))}; t.O=t.w.extend({l:function(a,c){t.w.call(this,a,c);this.update();this.b("keydown",this.ja);this.c.setAttribute("aria-haspopup",f);this.c.setAttribute("role","button")}});s=t.O.prototype;s.update=function(){var a=this.Ja();this.xa&&this.removeChild(this.xa);this.xa=a;this.ba(a);this.H&&0===this.H.length?this.X():this.H&&1'+this.v("Stream Type")+""+this.v("LIVE"),"aria-live":"off"});a.appendChild(this.B);return a};t.nc=t.w.extend({l:function(a,c){t.w.call(this,a,c);this.b(a,"play",this.$b);this.b(a,"pause",this.Zb)}});s=t.nc.prototype;s.sa="Play"; -s.T=function(){return"vjs-play-control "+t.w.prototype.T.call(this)};s.u=function(){this.d.paused()?this.d.play():this.d.pause()};s.$b=function(){this.r("vjs-paused");this.p("vjs-playing");this.c.children[0].children[0].innerHTML=this.v("Pause")};s.Zb=function(){this.r("vjs-playing");this.p("vjs-paused");this.c.children[0].children[0].innerHTML=this.v("Play")};t.vb=t.a.extend({l:function(a,c){t.a.call(this,a,c);this.b(a,"timeupdate",this.ma)}}); +s.U=function(){return"vjs-play-control "+t.w.prototype.U.call(this)};s.u=function(){this.d.paused()?this.d.play():this.d.pause()};s.$b=function(){this.r("vjs-paused");this.p("vjs-playing");this.c.children[0].children[0].innerHTML=this.v("Pause")};s.Zb=function(){this.r("vjs-playing");this.p("vjs-paused");this.c.children[0].children[0].innerHTML=this.v("Play")};t.vb=t.a.extend({l:function(a,c){t.a.call(this,a,c);this.b(a,"timeupdate",this.ma)}}); t.vb.prototype.e=function(){var a=t.a.prototype.e.call(this,"div",{className:"vjs-current-time vjs-time-controls vjs-control"});this.B=t.e("div",{className:"vjs-current-time-display",innerHTML:'Current Time 0:00',"aria-live":"off"});a.appendChild(this.B);return a};t.vb.prototype.ma=function(){var a=this.d.ob?this.d.K.currentTime:this.d.currentTime();this.B.innerHTML=''+this.v("Current Time")+" "+t.Ma(a,this.d.duration())}; t.wb=t.a.extend({l:function(a,c){t.a.call(this,a,c);this.b(a,"timeupdate",this.ma)}});t.wb.prototype.e=function(){var a=t.a.prototype.e.call(this,"div",{className:"vjs-duration vjs-time-controls vjs-control"});this.B=t.e("div",{className:"vjs-duration-display",innerHTML:''+this.v("Duration Time")+" 0:00","aria-live":"off"});a.appendChild(this.B);return a}; t.wb.prototype.ma=function(){var a=this.d.duration();a&&(this.B.innerHTML=''+this.v("Duration Time")+" "+t.Ma(a))};t.tc=t.a.extend({l:function(a,c){t.a.call(this,a,c)}});t.tc.prototype.e=function(){return t.a.prototype.e.call(this,"div",{className:"vjs-time-divider",innerHTML:"
/
"})};t.Db=t.a.extend({l:function(a,c){t.a.call(this,a,c);this.b(a,"timeupdate",this.ma)}}); t.Db.prototype.e=function(){var a=t.a.prototype.e.call(this,"div",{className:"vjs-remaining-time vjs-time-controls vjs-control"});this.B=t.e("div",{className:"vjs-remaining-time-display",innerHTML:''+this.v("Remaining Time")+" -0:00","aria-live":"off"});a.appendChild(this.B);return a};t.Db.prototype.ma=function(){this.d.duration()&&(this.B.innerHTML=''+this.v("Remaining Time")+" -"+t.Ma(this.d.remainingTime()))}; -t.Za=t.w.extend({l:function(a,c){t.w.call(this,a,c)}});t.Za.prototype.sa="Fullscreen";t.Za.prototype.T=function(){return"vjs-fullscreen-control "+t.w.prototype.T.call(this)};t.Za.prototype.u=function(){this.d.isFullscreen()?(this.d.exitFullscreen(),this.Jb.innerHTML=this.v("Fullscreen")):(this.d.requestFullscreen(),this.Jb.innerHTML=this.v("Non-Fullscreen"))};t.Cb=t.a.extend({l:function(a,c){t.a.call(this,a,c)}});t.Cb.prototype.q={children:{seekBar:{}}}; -t.Cb.prototype.e=function(){return t.a.prototype.e.call(this,"div",{className:"vjs-progress-control vjs-control"})};t.qc=t.S.extend({l:function(a,c){t.S.call(this,a,c);this.b(a,"timeupdate",this.Ca);a.I(t.bind(this,this.Ca))}});s=t.qc.prototype;s.q={children:{loadProgressBar:{},playProgressBar:{},seekHandle:{}},barName:"playProgressBar",handleName:"seekHandle"};s.Yc="timeupdate";s.e=function(){return t.S.prototype.e.call(this,"div",{className:"vjs-progress-holder","aria-label":"video progress bar"})}; -s.Ca=function(){var a=this.d.ob?this.d.K.currentTime:this.d.currentTime();this.c.setAttribute("aria-valuenow",t.round(100*this.Sb(),2));this.c.setAttribute("aria-valuetext",t.Ma(a,this.d.duration()))};s.Sb=function(){return this.d.currentTime()/this.d.duration()};s.mb=function(a){t.S.prototype.mb.call(this,a);this.d.ob=f;this.d.p("vjs-scrubbing");this.df=!this.d.paused();this.d.pause()};s.ka=function(a){a=ea(this,a)*this.d.duration();a==this.d.duration()&&(a-=0.1);this.d.currentTime(a)}; -s.za=function(a){t.S.prototype.za.call(this,a);this.d.ob=l;this.d.r("vjs-scrubbing");this.df&&this.d.play()};s.kd=function(){this.d.currentTime(this.d.currentTime()+5)};s.jd=function(){this.d.currentTime(this.d.currentTime()-5)};t.zb=t.a.extend({l:function(a,c){t.a.call(this,a,c);this.b(a,"progress",this.update)}});t.zb.prototype.e=function(){return t.a.prototype.e.call(this,"div",{className:"vjs-load-progress",innerHTML:''+this.v("Loaded")+": 0%"})}; +t.Za=t.w.extend({l:function(a,c){t.w.call(this,a,c)}});t.Za.prototype.sa="Fullscreen";t.Za.prototype.U=function(){return"vjs-fullscreen-control "+t.w.prototype.U.call(this)};t.Za.prototype.u=function(){this.d.isFullscreen()?(this.d.exitFullscreen(),this.Jb.innerHTML=this.v("Fullscreen")):(this.d.requestFullscreen(),this.Jb.innerHTML=this.v("Non-Fullscreen"))};t.Cb=t.a.extend({l:function(a,c){t.a.call(this,a,c)}});t.Cb.prototype.q={children:{seekBar:{}}}; +t.Cb.prototype.e=function(){return t.a.prototype.e.call(this,"div",{className:"vjs-progress-control vjs-control"})};t.qc=t.T.extend({l:function(a,c){t.T.call(this,a,c);this.b(a,"timeupdate",this.Ca);a.I(t.bind(this,this.Ca))}});s=t.qc.prototype;s.q={children:{loadProgressBar:{},playProgressBar:{},seekHandle:{}},barName:"playProgressBar",handleName:"seekHandle"};s.Yc="timeupdate";s.e=function(){return t.T.prototype.e.call(this,"div",{className:"vjs-progress-holder","aria-label":"video progress bar"})}; +s.Ca=function(){var a=this.d.ob?this.d.K.currentTime:this.d.currentTime();this.c.setAttribute("aria-valuenow",t.round(100*this.Sb(),2));this.c.setAttribute("aria-valuetext",t.Ma(a,this.d.duration()))};s.Sb=function(){return this.d.currentTime()/this.d.duration()};s.mb=function(a){t.T.prototype.mb.call(this,a);this.d.ob=f;this.d.p("vjs-scrubbing");this.df=!this.d.paused();this.d.pause()};s.ka=function(a){a=ea(this,a)*this.d.duration();a==this.d.duration()&&(a-=0.1);this.d.currentTime(a)}; +s.za=function(a){t.T.prototype.za.call(this,a);this.d.ob=l;this.d.r("vjs-scrubbing");this.df&&this.d.play()};s.kd=function(){this.d.currentTime(this.d.currentTime()+5)};s.jd=function(){this.d.currentTime(this.d.currentTime()-5)};t.zb=t.a.extend({l:function(a,c){t.a.call(this,a,c);this.b(a,"progress",this.update)}});t.zb.prototype.e=function(){return t.a.prototype.e.call(this,"div",{className:"vjs-load-progress",innerHTML:''+this.v("Loaded")+": 0%"})}; t.zb.prototype.update=function(){var a,c,d,e,g=this.d.buffered();a=this.d.duration();var h,k=this.d;h=k.buffered();k=k.duration();h=h.end(h.length-1);h>k&&(h=k);k=this.c.children;this.c.style.width=100*(h/a||0)+"%";for(a=0;ag.length;a--)this.c.removeChild(k[a-1])};t.mc=t.a.extend({l:function(a,c){t.a.call(this,a,c)}}); t.mc.prototype.e=function(){return t.a.prototype.e.call(this,"div",{className:"vjs-play-progress",innerHTML:''+this.v("Progress")+": 0%"})};t.$a=t.ga.extend({l:function(a,c){t.ga.call(this,a,c);this.b(a,"timeupdate",this.ma)}});t.$a.prototype.defaultValue="00:00";t.$a.prototype.e=function(){return t.ga.prototype.e.call(this,"div",{className:"vjs-seek-handle","aria-live":"off"})}; t.$a.prototype.ma=function(){var a=this.d.ob?this.d.K.currentTime:this.d.currentTime();this.c.innerHTML=''+t.Ma(a,this.d.duration())+""};t.Gb=t.a.extend({l:function(a,c){t.a.call(this,a,c);a.h&&a.h.featuresVolumeControl===l&&this.p("vjs-hidden");this.b(a,"loadstart",function(){a.h.featuresVolumeControl===l?this.p("vjs-hidden"):this.r("vjs-hidden")})}});t.Gb.prototype.q={children:{volumeBar:{}}}; -t.Gb.prototype.e=function(){return t.a.prototype.e.call(this,"div",{className:"vjs-volume-control vjs-control"})};t.Fb=t.S.extend({l:function(a,c){t.S.call(this,a,c);this.b(a,"volumechange",this.Ca);a.I(t.bind(this,this.Ca))}});s=t.Fb.prototype;s.Ca=function(){this.c.setAttribute("aria-valuenow",t.round(100*this.d.volume(),2));this.c.setAttribute("aria-valuetext",t.round(100*this.d.volume(),2)+"%")};s.q={children:{volumeLevel:{},volumeHandle:{}},barName:"volumeLevel",handleName:"volumeHandle"}; -s.Yc="volumechange";s.e=function(){return t.S.prototype.e.call(this,"div",{className:"vjs-volume-bar","aria-label":"volume level"})};s.ka=function(a){this.d.muted()&&this.d.muted(l);this.d.volume(ea(this,a))};s.Sb=function(){return this.d.muted()?0:this.d.volume()};s.kd=function(){this.d.volume(this.d.volume()+0.1)};s.jd=function(){this.d.volume(this.d.volume()-0.1)};t.uc=t.a.extend({l:function(a,c){t.a.call(this,a,c)}}); +t.Gb.prototype.e=function(){return t.a.prototype.e.call(this,"div",{className:"vjs-volume-control vjs-control"})};t.Fb=t.T.extend({l:function(a,c){t.T.call(this,a,c);this.b(a,"volumechange",this.Ca);a.I(t.bind(this,this.Ca))}});s=t.Fb.prototype;s.Ca=function(){this.c.setAttribute("aria-valuenow",t.round(100*this.d.volume(),2));this.c.setAttribute("aria-valuetext",t.round(100*this.d.volume(),2)+"%")};s.q={children:{volumeLevel:{},volumeHandle:{}},barName:"volumeLevel",handleName:"volumeHandle"}; +s.Yc="volumechange";s.e=function(){return t.T.prototype.e.call(this,"div",{className:"vjs-volume-bar","aria-label":"volume level"})};s.ka=function(a){this.d.muted()&&this.d.muted(l);this.d.volume(ea(this,a))};s.Sb=function(){return this.d.muted()?0:this.d.volume()};s.kd=function(){this.d.volume(this.d.volume()+0.1)};s.jd=function(){this.d.volume(this.d.volume()-0.1)};t.uc=t.a.extend({l:function(a,c){t.a.call(this,a,c)}}); t.uc.prototype.e=function(){return t.a.prototype.e.call(this,"div",{className:"vjs-volume-level",innerHTML:''})};t.Hb=t.ga.extend();t.Hb.prototype.defaultValue="00:00";t.Hb.prototype.e=function(){return t.ga.prototype.e.call(this,"div",{className:"vjs-volume-handle"})}; t.qa=t.w.extend({l:function(a,c){t.w.call(this,a,c);this.b(a,"volumechange",this.update);a.h&&a.h.featuresVolumeControl===l&&this.p("vjs-hidden");this.b(a,"loadstart",function(){a.h.featuresVolumeControl===l?this.p("vjs-hidden"):this.r("vjs-hidden")})}});t.qa.prototype.e=function(){return t.w.prototype.e.call(this,"div",{className:"vjs-mute-control vjs-control",innerHTML:'
'+this.v("Mute")+"
"})}; t.qa.prototype.u=function(){this.d.muted(this.d.muted()?l:f)};t.qa.prototype.update=function(){var a=this.d.volume(),c=3;0===a||this.d.muted()?c=0:0.33>a?c=1:0.67>a&&(c=2);this.d.muted()?this.c.children[0].children[0].innerHTML!=this.v("Unmute")&&(this.c.children[0].children[0].innerHTML=this.v("Unmute")):this.c.children[0].children[0].innerHTML!=this.v("Mute")&&(this.c.children[0].children[0].innerHTML=this.v("Mute"));for(a=0;4>a;a++)t.r(this.c,"vjs-vol-"+a);t.p(this.c,"vjs-vol-"+c)}; @@ -112,21 +112,21 @@ s.u=function(a){0===a.button&&this.k().controls()&&(this.k().paused()?this.k().p s.se=function(){var a=this.d;this.Yb=f;this.b(a,"play",this.pd);this.b(a,"pause",this.rb);this.N("timeupdate",function(){this.featuresTimeupdateEvents=f;this.Vc()})};s.Vc=function(){var a=this.d;this.Yb=l;this.rb();this.n(a,"play",this.pd);this.n(a,"pause",this.rb)};s.pd=function(){this.Fc&&this.rb();this.Fc=this.setInterval(function(){this.k().o("timeupdate")},250)};s.rb=function(){this.clearInterval(this.Fc);this.k().o("timeupdate")};s.dispose=function(){this.Uc&&this.qe();this.Yb&&this.Vc();t.a.prototype.dispose.call(this)}; s.bc=function(){this.Yb&&this.k().o("timeupdate")};s.he=function(){function a(){var a=c.ea("textTrackDisplay");a&&a.C()}var c=this.d,d;if(d=this.textTracks())d.addEventListener("removetrack",a),d.addEventListener("addtrack",a),this.b("dispose",t.bind(this,function(){d.removeEventListener("removetrack",a);d.removeEventListener("addtrack",a)}))}; s.Vd=function(){var a=this.d,c,d,e;window.WebVTT||(e=document.createElement("script"),e.src=a.options()["vtt.js"]||"../node_modules/vtt.js/dist/vtt.js",a.m().appendChild(e),window.WebVTT=f);if(d=this.textTracks())c=function(){var c,d,e;e=a.ea("textTrackDisplay");e.C();for(c=0;c>>0;if(0===g)return-1;d=+c||0;Infinity===Math.abs(d)&&(d=0);if(d>=g)return-1;for(d=Math.max(0<=d?d:g-Math.abs(d),0);d=this.H.length&&this.X();d&&(e=t.bind(this,this.update),d.addEventListener("removetrack",e),d.addEventListener("addtrack",e),this.d.b("dispose",function(){d.removeEventListener("removetrack",e);d.removeEventListener("addtrack",e)}))}}); t.Q.prototype.Ia=function(){var a=[],c,d;this instanceof t.na&&(!this.k().h||!this.k().h.featuresNativeTextTracks)&&a.push(new t.tb(this.d,{kind:this.fa}));a.push(new t.Ab(this.d,{kind:this.fa}));d=this.d.textTracks();if(!d)return a;for(var e=0;ea?this.show():this.X()};t.ab=t.Q.extend({l:function(a,c,d){t.Q.call(this,a,c,d);this.c.setAttribute("aria-label","Subtitles Menu")}});t.ab.prototype.fa="subtitles";t.ab.prototype.sa="Subtitles";t.ab.prototype.className="vjs-subtitles-button"; t.Xa=t.Q.extend({l:function(a,c,d){t.Q.call(this,a,c,d);this.c.setAttribute("aria-label","Chapters Menu")}});s=t.Xa.prototype;s.fa="chapters";s.sa="Chapters";s.className="vjs-chapters-button";s.Ia=function(){var a=[],c,d;d=this.d.textTracks();if(!d)return a;for(var e=0;e select").selectedIndex=0;this.m().querySelector(".vjs-bg-color > select").selectedIndex=0;this.m().querySelector(".window-color > select").selectedIndex=0;this.m().querySelector(".vjs-text-opacity > select").selectedIndex= 0;this.m().querySelector(".vjs-bg-opacity > select").selectedIndex=0;this.m().querySelector(".vjs-window-opacity > select").selectedIndex=0;this.m().querySelector(".vjs-edge-style select").selectedIndex=0;this.m().querySelector(".vjs-font-family select").selectedIndex=0;this.m().querySelector(".vjs-font-percent select").selectedIndex=2;this.C()}));t.b(this.m().querySelector(".vjs-fg-color > select"),"change",t.bind(this,this.C));t.b(this.m().querySelector(".vjs-bg-color > select"),"change",t.bind(this, @@ -181,11 +181,11 @@ a.charCodeAt(0).toString(16)).slice(-4)}));if(/^[\],:{}\s]*$/.test(a.replace(/\\ t.xc=function(){var a,c,d,e;a=document.getElementsByTagName("video");c=document.getElementsByTagName("audio");var g=[];if(a&&0e&&(a.preventDefault(),this.o("tap")))})} s.setTimeout=function(a,c){function d(){this.clearTimeout(e)}a=t.bind(this,a);var e=setTimeout(a,c);d.s="vjs-timeout-"+e;this.b("dispose",d);return e};s.clearTimeout=function(a){function c(){}clearTimeout(a);c.s="vjs-timeout-"+a;this.n("dispose",c);return a};s.setInterval=function(a,c){function d(){this.clearInterval(e)}a=t.bind(this,a);var e=setInterval(a,c);d.s="vjs-interval-"+e;this.b("dispose",d);return e}; s.clearInterval=function(a){function c(){}clearInterval(a);c.s="vjs-interval-"+a;this.n("dispose",c);return a};t.w=t.a.extend({l:function(a,c){t.a.call(this,a,c);da(this);this.b("tap",this.u);this.b("click",this.u);this.b("focus",this.lb);this.b("blur",this.kb)}});s=t.w.prototype; -s.e=function(a,c){var d;c=t.i.D({className:this.T(),role:"button","aria-live":"polite",tabIndex:0},c);d=t.a.prototype.e.call(this,a,c);c.innerHTML||(this.B=t.e("div",{className:"vjs-control-content"}),this.Jb=t.e("span",{className:"vjs-control-text",innerHTML:this.v(this.sa)||"Need Text"}),this.B.appendChild(this.Jb),d.appendChild(this.B));return d};s.T=function(){return"vjs-control "+t.a.prototype.T.call(this)};s.u=m();s.lb=function(){t.b(document,"keydown",t.bind(this,this.ja))}; -s.ja=function(a){if(32==a.which||13==a.which)a.preventDefault(),this.u()};s.kb=function(){t.n(document,"keydown",t.bind(this,this.ja))};t.S=t.a.extend({l:function(a,c){t.a.call(this,a,c);this.Kd=this.ea(this.q.barName);this.handle=this.ea(this.q.handleName);this.b("mousedown",this.mb);this.b("touchstart",this.mb);this.b("focus",this.lb);this.b("blur",this.kb);this.b("click",this.u);this.b(a,"controlsvisible",this.update);this.b(a,this.Yc,this.update)}});s=t.S.prototype; +s.e=function(a,c){var d;c=t.i.D({className:this.U(),role:"button","aria-live":"polite",tabIndex:0},c);d=t.a.prototype.e.call(this,a,c);c.innerHTML||(this.B=t.e("div",{className:"vjs-control-content"}),this.Jb=t.e("span",{className:"vjs-control-text",innerHTML:this.v(this.sa)||"Need Text"}),this.B.appendChild(this.Jb),d.appendChild(this.B));return d};s.U=function(){return"vjs-control "+t.a.prototype.U.call(this)};s.u=m();s.lb=function(){t.b(document,"keydown",t.bind(this,this.ja))}; +s.ja=function(a){if(32==a.which||13==a.which)a.preventDefault(),this.u()};s.kb=function(){t.n(document,"keydown",t.bind(this,this.ja))};t.T=t.a.extend({l:function(a,c){t.a.call(this,a,c);this.Kd=this.ea(this.q.barName);this.handle=this.ea(this.q.handleName);this.b("mousedown",this.mb);this.b("touchstart",this.mb);this.b("focus",this.lb);this.b("blur",this.kb);this.b("click",this.u);this.b(a,"controlsvisible",this.update);this.b(a,this.Yc,this.update)}});s=t.T.prototype; s.e=function(a,c){c=c||{};c.className+=" vjs-slider";c=t.i.D({role:"slider","aria-valuenow":0,"aria-valuemin":0,"aria-valuemax":100,tabIndex:0},c);return t.a.prototype.e.call(this,a,c)};s.mb=function(a){a.preventDefault();t.Ld();this.p("vjs-sliding");this.b(document,"mousemove",this.ka);this.b(document,"mouseup",this.za);this.b(document,"touchmove",this.ka);this.b(document,"touchend",this.za);this.ka(a)};s.ka=m(); s.za=function(){t.af();this.r("vjs-sliding");this.n(document,"mousemove",this.ka);this.n(document,"mouseup",this.za);this.n(document,"touchmove",this.ka);this.n(document,"touchend",this.za);this.update()};s.update=function(){if(this.c){var a,c=this.Sb(),d=this.handle,e=this.Kd;if("number"!==typeof c||c!==c||0>c||Infinity===c)c=0;a=c;if(d){a=this.c.offsetWidth;var g=d.m().offsetWidth;a=g?g/a:0;c*=1-a;a=c+a/2;d.m().style.left=t.round(100*c,2)+"%"}e&&(e.m().style.width=t.round(100*a,2)+"%")}}; function ea(a,c){var d,e,g,h;d=a.c;e=t.Yd(d);h=g=d.offsetWidth;d=a.handle;if(a.options().vertical)return h=e.top,e=c.changedTouches?c.changedTouches[0].pageY:c.pageY,d&&(d=d.m().offsetHeight,h+=d/2,g-=d),Math.max(0,Math.min(1,(h-e+g)/g));g=e.left;e=c.changedTouches?c.changedTouches[0].pageX:c.pageX;d&&(d=d.m().offsetWidth,g+=d/2,h-=d);return Math.max(0,Math.min(1,(e-g)/h))}s.lb=function(){this.b(document,"keydown",this.ja)}; @@ -47,7 +47,7 @@ s.ja=function(a){if(37==a.which||40==a.which)a.preventDefault(),this.jd();else i t.pa=t.a.extend();function fa(a,c){a.ba(c);c.b("click",t.bind(a,function(){G(this)}))}t.pa.prototype.e=function(){var a=this.options().Cc||"ul";this.B=t.e(a,{className:"vjs-menu-content"});a=t.a.prototype.e.call(this,"div",{append:this.B,className:"vjs-menu"});a.appendChild(this.B);t.b(a,"click",function(a){a.preventDefault();a.stopImmediatePropagation()});return a};t.M=t.w.extend({l:function(a,c){t.w.call(this,a,c);this.selected(c.selected)}}); t.M.prototype.e=function(a,c){return t.w.prototype.e.call(this,"li",t.i.D({className:"vjs-menu-item",innerHTML:this.v(this.q.label)},c))};t.M.prototype.u=function(){this.selected(f)};t.M.prototype.selected=function(a){a?(this.p("vjs-selected"),this.c.setAttribute("aria-selected",f)):(this.r("vjs-selected"),this.c.setAttribute("aria-selected",l))}; t.O=t.w.extend({l:function(a,c){t.w.call(this,a,c);this.update();this.b("keydown",this.ja);this.c.setAttribute("aria-haspopup",f);this.c.setAttribute("role","button")}});s=t.O.prototype;s.update=function(){var a=this.Ja();this.xa&&this.removeChild(this.xa);this.xa=a;this.ba(a);this.H&&0===this.H.length?this.X():this.H&&1'+this.v("Stream Type")+""+this.v("LIVE"),"aria-live":"off"});a.appendChild(this.B);return a};t.nc=t.w.extend({l:function(a,c){t.w.call(this,a,c);this.b(a,"play",this.$b);this.b(a,"pause",this.Zb)}});s=t.nc.prototype;s.sa="Play"; -s.T=function(){return"vjs-play-control "+t.w.prototype.T.call(this)};s.u=function(){this.d.paused()?this.d.play():this.d.pause()};s.$b=function(){this.r("vjs-paused");this.p("vjs-playing");this.c.children[0].children[0].innerHTML=this.v("Pause")};s.Zb=function(){this.r("vjs-playing");this.p("vjs-paused");this.c.children[0].children[0].innerHTML=this.v("Play")};t.vb=t.a.extend({l:function(a,c){t.a.call(this,a,c);this.b(a,"timeupdate",this.ma)}}); +s.U=function(){return"vjs-play-control "+t.w.prototype.U.call(this)};s.u=function(){this.d.paused()?this.d.play():this.d.pause()};s.$b=function(){this.r("vjs-paused");this.p("vjs-playing");this.c.children[0].children[0].innerHTML=this.v("Pause")};s.Zb=function(){this.r("vjs-playing");this.p("vjs-paused");this.c.children[0].children[0].innerHTML=this.v("Play")};t.vb=t.a.extend({l:function(a,c){t.a.call(this,a,c);this.b(a,"timeupdate",this.ma)}}); t.vb.prototype.e=function(){var a=t.a.prototype.e.call(this,"div",{className:"vjs-current-time vjs-time-controls vjs-control"});this.B=t.e("div",{className:"vjs-current-time-display",innerHTML:'Current Time 0:00',"aria-live":"off"});a.appendChild(this.B);return a};t.vb.prototype.ma=function(){var a=this.d.ob?this.d.K.currentTime:this.d.currentTime();this.B.innerHTML=''+this.v("Current Time")+" "+t.Ma(a,this.d.duration())}; t.wb=t.a.extend({l:function(a,c){t.a.call(this,a,c);this.b(a,"timeupdate",this.ma)}});t.wb.prototype.e=function(){var a=t.a.prototype.e.call(this,"div",{className:"vjs-duration vjs-time-controls vjs-control"});this.B=t.e("div",{className:"vjs-duration-display",innerHTML:''+this.v("Duration Time")+" 0:00","aria-live":"off"});a.appendChild(this.B);return a}; t.wb.prototype.ma=function(){var a=this.d.duration();a&&(this.B.innerHTML=''+this.v("Duration Time")+" "+t.Ma(a))};t.tc=t.a.extend({l:function(a,c){t.a.call(this,a,c)}});t.tc.prototype.e=function(){return t.a.prototype.e.call(this,"div",{className:"vjs-time-divider",innerHTML:"
/
"})};t.Db=t.a.extend({l:function(a,c){t.a.call(this,a,c);this.b(a,"timeupdate",this.ma)}}); t.Db.prototype.e=function(){var a=t.a.prototype.e.call(this,"div",{className:"vjs-remaining-time vjs-time-controls vjs-control"});this.B=t.e("div",{className:"vjs-remaining-time-display",innerHTML:''+this.v("Remaining Time")+" -0:00","aria-live":"off"});a.appendChild(this.B);return a};t.Db.prototype.ma=function(){this.d.duration()&&(this.B.innerHTML=''+this.v("Remaining Time")+" -"+t.Ma(this.d.remainingTime()))}; -t.Za=t.w.extend({l:function(a,c){t.w.call(this,a,c)}});t.Za.prototype.sa="Fullscreen";t.Za.prototype.T=function(){return"vjs-fullscreen-control "+t.w.prototype.T.call(this)};t.Za.prototype.u=function(){this.d.isFullscreen()?(this.d.exitFullscreen(),this.Jb.innerHTML=this.v("Fullscreen")):(this.d.requestFullscreen(),this.Jb.innerHTML=this.v("Non-Fullscreen"))};t.Cb=t.a.extend({l:function(a,c){t.a.call(this,a,c)}});t.Cb.prototype.q={children:{seekBar:{}}}; -t.Cb.prototype.e=function(){return t.a.prototype.e.call(this,"div",{className:"vjs-progress-control vjs-control"})};t.qc=t.S.extend({l:function(a,c){t.S.call(this,a,c);this.b(a,"timeupdate",this.Ca);a.I(t.bind(this,this.Ca))}});s=t.qc.prototype;s.q={children:{loadProgressBar:{},playProgressBar:{},seekHandle:{}},barName:"playProgressBar",handleName:"seekHandle"};s.Yc="timeupdate";s.e=function(){return t.S.prototype.e.call(this,"div",{className:"vjs-progress-holder","aria-label":"video progress bar"})}; -s.Ca=function(){var a=this.d.ob?this.d.K.currentTime:this.d.currentTime();this.c.setAttribute("aria-valuenow",t.round(100*this.Sb(),2));this.c.setAttribute("aria-valuetext",t.Ma(a,this.d.duration()))};s.Sb=function(){return this.d.currentTime()/this.d.duration()};s.mb=function(a){t.S.prototype.mb.call(this,a);this.d.ob=f;this.d.p("vjs-scrubbing");this.df=!this.d.paused();this.d.pause()};s.ka=function(a){a=ea(this,a)*this.d.duration();a==this.d.duration()&&(a-=0.1);this.d.currentTime(a)}; -s.za=function(a){t.S.prototype.za.call(this,a);this.d.ob=l;this.d.r("vjs-scrubbing");this.df&&this.d.play()};s.kd=function(){this.d.currentTime(this.d.currentTime()+5)};s.jd=function(){this.d.currentTime(this.d.currentTime()-5)};t.zb=t.a.extend({l:function(a,c){t.a.call(this,a,c);this.b(a,"progress",this.update)}});t.zb.prototype.e=function(){return t.a.prototype.e.call(this,"div",{className:"vjs-load-progress",innerHTML:''+this.v("Loaded")+": 0%"})}; +t.Za=t.w.extend({l:function(a,c){t.w.call(this,a,c)}});t.Za.prototype.sa="Fullscreen";t.Za.prototype.U=function(){return"vjs-fullscreen-control "+t.w.prototype.U.call(this)};t.Za.prototype.u=function(){this.d.isFullscreen()?(this.d.exitFullscreen(),this.Jb.innerHTML=this.v("Fullscreen")):(this.d.requestFullscreen(),this.Jb.innerHTML=this.v("Non-Fullscreen"))};t.Cb=t.a.extend({l:function(a,c){t.a.call(this,a,c)}});t.Cb.prototype.q={children:{seekBar:{}}}; +t.Cb.prototype.e=function(){return t.a.prototype.e.call(this,"div",{className:"vjs-progress-control vjs-control"})};t.qc=t.T.extend({l:function(a,c){t.T.call(this,a,c);this.b(a,"timeupdate",this.Ca);a.I(t.bind(this,this.Ca))}});s=t.qc.prototype;s.q={children:{loadProgressBar:{},playProgressBar:{},seekHandle:{}},barName:"playProgressBar",handleName:"seekHandle"};s.Yc="timeupdate";s.e=function(){return t.T.prototype.e.call(this,"div",{className:"vjs-progress-holder","aria-label":"video progress bar"})}; +s.Ca=function(){var a=this.d.ob?this.d.K.currentTime:this.d.currentTime();this.c.setAttribute("aria-valuenow",t.round(100*this.Sb(),2));this.c.setAttribute("aria-valuetext",t.Ma(a,this.d.duration()))};s.Sb=function(){return this.d.currentTime()/this.d.duration()};s.mb=function(a){t.T.prototype.mb.call(this,a);this.d.ob=f;this.d.p("vjs-scrubbing");this.df=!this.d.paused();this.d.pause()};s.ka=function(a){a=ea(this,a)*this.d.duration();a==this.d.duration()&&(a-=0.1);this.d.currentTime(a)}; +s.za=function(a){t.T.prototype.za.call(this,a);this.d.ob=l;this.d.r("vjs-scrubbing");this.df&&this.d.play()};s.kd=function(){this.d.currentTime(this.d.currentTime()+5)};s.jd=function(){this.d.currentTime(this.d.currentTime()-5)};t.zb=t.a.extend({l:function(a,c){t.a.call(this,a,c);this.b(a,"progress",this.update)}});t.zb.prototype.e=function(){return t.a.prototype.e.call(this,"div",{className:"vjs-load-progress",innerHTML:''+this.v("Loaded")+": 0%"})}; t.zb.prototype.update=function(){var a,c,d,e,g=this.d.buffered();a=this.d.duration();var h,k=this.d;h=k.buffered();k=k.duration();h=h.end(h.length-1);h>k&&(h=k);k=this.c.children;this.c.style.width=100*(h/a||0)+"%";for(a=0;ag.length;a--)this.c.removeChild(k[a-1])};t.mc=t.a.extend({l:function(a,c){t.a.call(this,a,c)}}); t.mc.prototype.e=function(){return t.a.prototype.e.call(this,"div",{className:"vjs-play-progress",innerHTML:''+this.v("Progress")+": 0%"})};t.$a=t.ga.extend({l:function(a,c){t.ga.call(this,a,c);this.b(a,"timeupdate",this.ma)}});t.$a.prototype.defaultValue="00:00";t.$a.prototype.e=function(){return t.ga.prototype.e.call(this,"div",{className:"vjs-seek-handle","aria-live":"off"})}; t.$a.prototype.ma=function(){var a=this.d.ob?this.d.K.currentTime:this.d.currentTime();this.c.innerHTML=''+t.Ma(a,this.d.duration())+""};t.Gb=t.a.extend({l:function(a,c){t.a.call(this,a,c);a.h&&a.h.featuresVolumeControl===l&&this.p("vjs-hidden");this.b(a,"loadstart",function(){a.h.featuresVolumeControl===l?this.p("vjs-hidden"):this.r("vjs-hidden")})}});t.Gb.prototype.q={children:{volumeBar:{}}}; -t.Gb.prototype.e=function(){return t.a.prototype.e.call(this,"div",{className:"vjs-volume-control vjs-control"})};t.Fb=t.S.extend({l:function(a,c){t.S.call(this,a,c);this.b(a,"volumechange",this.Ca);a.I(t.bind(this,this.Ca))}});s=t.Fb.prototype;s.Ca=function(){this.c.setAttribute("aria-valuenow",t.round(100*this.d.volume(),2));this.c.setAttribute("aria-valuetext",t.round(100*this.d.volume(),2)+"%")};s.q={children:{volumeLevel:{},volumeHandle:{}},barName:"volumeLevel",handleName:"volumeHandle"}; -s.Yc="volumechange";s.e=function(){return t.S.prototype.e.call(this,"div",{className:"vjs-volume-bar","aria-label":"volume level"})};s.ka=function(a){this.d.muted()&&this.d.muted(l);this.d.volume(ea(this,a))};s.Sb=function(){return this.d.muted()?0:this.d.volume()};s.kd=function(){this.d.volume(this.d.volume()+0.1)};s.jd=function(){this.d.volume(this.d.volume()-0.1)};t.uc=t.a.extend({l:function(a,c){t.a.call(this,a,c)}}); +t.Gb.prototype.e=function(){return t.a.prototype.e.call(this,"div",{className:"vjs-volume-control vjs-control"})};t.Fb=t.T.extend({l:function(a,c){t.T.call(this,a,c);this.b(a,"volumechange",this.Ca);a.I(t.bind(this,this.Ca))}});s=t.Fb.prototype;s.Ca=function(){this.c.setAttribute("aria-valuenow",t.round(100*this.d.volume(),2));this.c.setAttribute("aria-valuetext",t.round(100*this.d.volume(),2)+"%")};s.q={children:{volumeLevel:{},volumeHandle:{}},barName:"volumeLevel",handleName:"volumeHandle"}; +s.Yc="volumechange";s.e=function(){return t.T.prototype.e.call(this,"div",{className:"vjs-volume-bar","aria-label":"volume level"})};s.ka=function(a){this.d.muted()&&this.d.muted(l);this.d.volume(ea(this,a))};s.Sb=function(){return this.d.muted()?0:this.d.volume()};s.kd=function(){this.d.volume(this.d.volume()+0.1)};s.jd=function(){this.d.volume(this.d.volume()-0.1)};t.uc=t.a.extend({l:function(a,c){t.a.call(this,a,c)}}); t.uc.prototype.e=function(){return t.a.prototype.e.call(this,"div",{className:"vjs-volume-level",innerHTML:''})};t.Hb=t.ga.extend();t.Hb.prototype.defaultValue="00:00";t.Hb.prototype.e=function(){return t.ga.prototype.e.call(this,"div",{className:"vjs-volume-handle"})}; t.qa=t.w.extend({l:function(a,c){t.w.call(this,a,c);this.b(a,"volumechange",this.update);a.h&&a.h.featuresVolumeControl===l&&this.p("vjs-hidden");this.b(a,"loadstart",function(){a.h.featuresVolumeControl===l?this.p("vjs-hidden"):this.r("vjs-hidden")})}});t.qa.prototype.e=function(){return t.w.prototype.e.call(this,"div",{className:"vjs-mute-control vjs-control",innerHTML:'
'+this.v("Mute")+"
"})}; t.qa.prototype.u=function(){this.d.muted(this.d.muted()?l:f)};t.qa.prototype.update=function(){var a=this.d.volume(),c=3;0===a||this.d.muted()?c=0:0.33>a?c=1:0.67>a&&(c=2);this.d.muted()?this.c.children[0].children[0].innerHTML!=this.v("Unmute")&&(this.c.children[0].children[0].innerHTML=this.v("Unmute")):this.c.children[0].children[0].innerHTML!=this.v("Mute")&&(this.c.children[0].children[0].innerHTML=this.v("Mute"));for(a=0;4>a;a++)t.r(this.c,"vjs-vol-"+a);t.p(this.c,"vjs-vol-"+c)}; @@ -111,21 +111,21 @@ s.u=function(a){0===a.button&&this.k().controls()&&(this.k().paused()?this.k().p s.se=function(){var a=this.d;this.Yb=f;this.b(a,"play",this.pd);this.b(a,"pause",this.rb);this.N("timeupdate",function(){this.featuresTimeupdateEvents=f;this.Vc()})};s.Vc=function(){var a=this.d;this.Yb=l;this.rb();this.n(a,"play",this.pd);this.n(a,"pause",this.rb)};s.pd=function(){this.Fc&&this.rb();this.Fc=this.setInterval(function(){this.k().o("timeupdate")},250)};s.rb=function(){this.clearInterval(this.Fc);this.k().o("timeupdate")};s.dispose=function(){this.Uc&&this.qe();this.Yb&&this.Vc();t.a.prototype.dispose.call(this)}; s.bc=function(){this.Yb&&this.k().o("timeupdate")};s.he=function(){function a(){var a=c.ea("textTrackDisplay");a&&a.C()}var c=this.d,d;if(d=this.textTracks())d.addEventListener("removetrack",a),d.addEventListener("addtrack",a),this.b("dispose",t.bind(this,function(){d.removeEventListener("removetrack",a);d.removeEventListener("addtrack",a)}))}; s.Vd=function(){var a=this.d,c,d,e;window.WebVTT||(e=document.createElement("script"),e.src=a.options()["vtt.js"]||"../node_modules/vtt.js/dist/vtt.js",a.m().appendChild(e),window.WebVTT=f);if(d=this.textTracks())c=function(){var c,d,e;e=a.ea("textTrackDisplay");e.C();for(c=0;c>>0;if(0===g)return-1;d=+c||0;Infinity===Math.abs(d)&&(d=0);if(d>=g)return-1;for(d=Math.max(0<=d?d:g-Math.abs(d),0);d=this.H.length&&this.X();d&&(e=t.bind(this,this.update),d.addEventListener("removetrack",e),d.addEventListener("addtrack",e),this.d.b("dispose",function(){d.removeEventListener("removetrack",e);d.removeEventListener("addtrack",e)}))}}); t.Q.prototype.Ia=function(){var a=[],c,d;this instanceof t.na&&(!this.k().h||!this.k().h.featuresNativeTextTracks)&&a.push(new t.tb(this.d,{kind:this.fa}));a.push(new t.Ab(this.d,{kind:this.fa}));d=this.d.textTracks();if(!d)return a;for(var e=0;ea?this.show():this.X()};t.ab=t.Q.extend({l:function(a,c,d){t.Q.call(this,a,c,d);this.c.setAttribute("aria-label","Subtitles Menu")}});t.ab.prototype.fa="subtitles";t.ab.prototype.sa="Subtitles";t.ab.prototype.className="vjs-subtitles-button"; t.Xa=t.Q.extend({l:function(a,c,d){t.Q.call(this,a,c,d);this.c.setAttribute("aria-label","Chapters Menu")}});s=t.Xa.prototype;s.fa="chapters";s.sa="Chapters";s.className="vjs-chapters-button";s.Ia=function(){var a=[],c,d;d=this.d.textTracks();if(!d)return a;for(var e=0;e select").selectedIndex=0;this.m().querySelector(".vjs-bg-color > select").selectedIndex=0;this.m().querySelector(".window-color > select").selectedIndex=0;this.m().querySelector(".vjs-text-opacity > select").selectedIndex= 0;this.m().querySelector(".vjs-bg-opacity > select").selectedIndex=0;this.m().querySelector(".vjs-window-opacity > select").selectedIndex=0;this.m().querySelector(".vjs-edge-style select").selectedIndex=0;this.m().querySelector(".vjs-font-family select").selectedIndex=0;this.m().querySelector(".vjs-font-percent select").selectedIndex=2;this.C()}));t.b(this.m().querySelector(".vjs-fg-color > select"),"change",t.bind(this,this.C));t.b(this.m().querySelector(".vjs-bg-color > select"),"change",t.bind(this, @@ -180,11 +180,11 @@ a.charCodeAt(0).toString(16)).slice(-4)}));if(/^[\],:{}\s]*$/.test(a.replace(/\\ t.xc=function(){var a,c,d,e;a=document.getElementsByTagName("video");c=document.getElementsByTagName("audio");var g=[];if(a&&0