-
Notifications
You must be signed in to change notification settings - Fork 7.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added a default swf url #2533
Added a default swf url #2533
Changes from 3 commits
6594562
213ce46
0db2822
621a957
b3936a5
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,6 +13,7 @@ import FlashRtmpDecorator from './flash-rtmp'; | |
import Component from '../component'; | ||
import window from 'global/window'; | ||
import assign from 'object.assign'; | ||
import pkg from '../../../package.json'; | ||
|
||
let navigator = window.navigator; | ||
/** | ||
|
@@ -69,6 +70,15 @@ 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) { | ||
let protocol = ('https:' === window.location.protocol ? 'https://' : 'http://'); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why not just use a protocol relative url? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks. Was copy/pasting from an old version. Fixed. |
||
options.swf = protocol+'vjs.zencdn.net/swf/'+pkg.dependencies['videojs-swf']+'/video-js.swf'; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. will the version string of the swf always be just the version? Could we at some point switch to using There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'd rather be more explicit with compiled dependencies. I made a note on the cdn repo "Patch releases should never change, including hosted dependencies". I don't want any risk of breaking patch-specific versions on the CDN. |
||
} | ||
|
||
// Generate ID for swf object | ||
let objId = options.techId; | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@gkatsev can you check my sanity on this approach?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, this does mean we include the whole package.json inside of the output. We probably want to use something like https://www.npmjs.com/package/browserify-versionify instead.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah, I was hoping to avoid another one of those... but it is better