diff --git a/grunt.js b/grunt.js index 9aa8667fa7..ea2e005a03 100644 --- a/grunt.js +++ b/grunt.js @@ -259,6 +259,10 @@ module.exports = function(grunt) { ['browserify-versionify', { placeholder: '__VERSION_NO_PATCH__', version: version.majorMinor + }], + ['browserify-versionify', { + placeholder: '__SWF_VERSION__', + version: pkg.dependencies['videojs-swf'] }] ] }, diff --git a/src/js/tech/flash.js b/src/js/tech/flash.js index 34a2932f8a..571756d2d7 100644 --- a/src/js/tech/flash.js +++ b/src/js/tech/flash.js @@ -69,6 +69,14 @@ class Flash extends Tech { createEl() { let options = this.options_; + // If video.js is hosted locally you should also set the location + // for the hosted swf, which should be relative to the page (not video.js) + // Otherwise this adds a CDN url. + // The CDN also auto-adds a swf URL for that specific version. + if (!options.swf) { + options.swf = '//vjs.zencdn.net/swf/__SWF_VERSION__/video-js.swf'; + } + // Generate ID for swf object let objId = options.techId;