You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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()andsrc() 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.
The text was updated successfully, but these errors were encountered:
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.
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 againstplayer.src()
which is still returning theblob
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 differentsrc()
andcurrentSrc()
and needing to restore the snapshot. See /~https://github.com/videojs/videojs-contrib-ads/blob/master/test/videojs.ads.snapshot.js#L343-L375I think the solution here would be to save both the
currentSrc()
andsrc()
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.The text was updated successfully, but these errors were encountered: