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

chore: update travis to test vjs5/6 and chrome/firefox #241

Merged
merged 3 commits into from
Apr 4, 2017

Conversation

brandonocasey
Copy link
Contributor

No description provided.

@gkatsev
Copy link
Member

gkatsev commented Feb 8, 2017

it's failing because of a breaking change in videojs 6 with regards to https://github.com/videojs/videojs-contrib-ads/blob/master/src/plugin.js#L185-L186

@misteroneill
Copy link
Member

Hmm, seems like that's gonna be an issue we'll have to figure out.

@incompl
Copy link
Contributor

incompl commented Feb 13, 2017

What change causes those lines to break?

@gkatsev
Copy link
Member

gkatsev commented Feb 13, 2017

We've changed player.src() to not return the blob url anymore. Since means that there's currently no way to get the actual src set on the video element and the current way of telling if the source has changed doesn't work anymore. A potential fix would be to get ask the tech directly for its src.

@incompl
Copy link
Contributor

incompl commented Feb 13, 2017

Is it really OK for there to be no way to get the actual src?

@gkatsev
Copy link
Member

gkatsev commented Feb 13, 2017

It's not that there isn't really a way. It just requires going through the tech right now (There's no way to get it directly from the player). Thinking about what src and currentSrc() are supposed to represent, especially with the new middleware feature, the changes make sense. We noticed this breakage back then and decided that it's still worth moving forward with the changes.

Basically, src() should be set to whatever url is actually set, and currentSrc() would be set to the middleware source. In the case of putting an HLS url directly, as opposed to having it be translated by middleware, src() and currentSrc() would end up returning the same url. currentSource() would be the object containing currentSrc() and currentType().

@incompl
Copy link
Contributor

incompl commented Feb 13, 2017

My understanding was that accessing the tech directly is an architectural antipattern, is that going to continue to be the case with vjs 6? Is this problem unique to contrib-ads for some reason?

@gkatsev
Copy link
Member

gkatsev commented Feb 13, 2017

Yeah, we've pulled back the curtain on tech a bit. There are times when it's definitely valid, though, should still be discouraged. player.tech() in 6.0 will log a warning, and could be silenced with any variable passed in.
Also, yeah, I think it's more of an issue with contrib-ads since it needs to be able to handle cases where the video element was changed directly. Most users of videojs would want the new behavior as it matches expectations of what should be happening more closely.

@misteroneill
Copy link
Member

misteroneill commented Feb 15, 2017

@brandonocasey If you don't mind, we can probably pretty easily update this PR to replace the src() check with a direct call to the tech. That should be consistent between Video.js 5 and 6.

EDIT: My $0.02 on talking directly with the tech is that it's kind of a grey area. As @gkatsev said there are definitely valid use-cases and this is one of them. I personally don't like that we expose a method, but require passing something to it.

// If no browsers are specified, we enable `karma-detect-browsers`
// this will detect all browsers that are available for testing
if (!config.browsers.length) {
detectBrowsers.enabled = true;
Copy link
Contributor

Choose a reason for hiding this comment

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

shouldn't karma-detect-browsers and karma-qunit be added to config.plugins to have browser detection and running the tests in a browser work locally?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

By default karma includes anything in plugins that matches the following: karma-* . So the default works in cases like this where the plugin is named karma-detect-browsers or karma-qunit. So we don't have to explicitly define anything in the plugins array.

Copy link
Contributor

Choose a reason for hiding this comment

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

Cool, good to know!

@incompl
Copy link
Contributor

incompl commented Feb 23, 2017

LGTM overall.

@ldayananda
Copy link
Contributor

LGTM, but should be tested before merging due to the code change.

@brandonocasey
Copy link
Contributor Author

available as videojs-contrib-ads@4.2.4-vjs6qa.0 and videojs-contrib-ads@vjs6qa on npm

@misteroneill
Copy link
Member

What testing does this need? The source code changes are really minimal and would be caught in unit tests...

@incompl
Copy link
Contributor

incompl commented Mar 9, 2017

We decided to test the VJS6 updates to IMA and contrib-ads together, so it's being tested that way.

@misteroneill misteroneill merged commit eec856a into master Apr 4, 2017
@misteroneill misteroneill deleted the chore/travis-update branch April 4, 2017 16:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants