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

Issue with currentSrc() and MSE and SourceHandlers #132

Closed
gkatsev opened this issue Dec 1, 2015 · 2 comments
Closed

Issue with currentSrc() and MSE and SourceHandlers #132

gkatsev opened this issue Dec 1, 2015 · 2 comments

Comments

@gkatsev
Copy link
Member

gkatsev commented Dec 1, 2015

In Videojs 5.2.2 we made it so that source handlers will return the saved source rather than the src from the video element. This is important for projects like contrib-hls, so that they can return a proper m3u8 url instead of a funky blob url.
This causes issues with ads because the snapshot saves the currentSrc() only but when restoring, it first checks against player.src() which is still returning the blob url. Since those are different, it tries to restore the video even though it shouldn't do that.
Adblockers apparently can sometimes interfere with currentSrc() getting set properly for native playback, which means that you can have a valid usecase for having a different src() and currentSrc() and needing to restore the snapshot. See /~https://github.com/videojs/videojs-contrib-ads/blob/master/test/videojs.ads.snapshot.js#L343-L375

I think the solution here would be to save both the currentSrc() and src() values and compare both of them before restoring the snapshot.
In the meantime, once videojs/video.js#2852 is in, before starting ads, the integration (or contrib-ads itself, even), could set the src('') to reset the player so the source will always be different and we'd always be restoring it.

@misteroneill
Copy link
Member

Post video.js 5.2.2, this is causing an issue with integrations with contrib-ads where the video's poster is displayed after an ad ends because it detects that the src has changed and resets the player.

misteroneill added a commit that referenced this issue Dec 2, 2015
@misteroneill
Copy link
Member

Closed by #133

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

No branches or pull requests

2 participants