Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Added a default swf url #2533

Closed
wants to merge 5 commits into from
Closed
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions src/js/tech/flash.js
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Copy link
Member Author

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?

Copy link
Member

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.

Copy link
Member Author

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


let navigator = window.navigator;
/**
Expand Down Expand Up @@ -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://');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why not just use a protocol relative url?

Copy link
Member Author

Choose a reason for hiding this comment

The 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';
Copy link
Member

Choose a reason for hiding this comment

The 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 ^ or anything that could cause this to break?

Copy link
Member Author

Choose a reason for hiding this comment

The 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;

Expand Down