videojs / video.js

Video.js - open source HTML5 video player
https://videojs.com
Other
37.87k stars 7.43k forks source link

Video keeps playing after pausing it (while playing ads via IMA) #8652

Closed davlasq closed 5 months ago

davlasq commented 6 months ago

Description

I use IMA for playing ads in my player. I have this setup for months and everything was fine until recently. The problem is video and ad are playing at the same time. I pause video before playing ad but it keeps playing. I can only replicate this problem on Chrome on Android but other users claim to have this issue in different scenarios. In production it happens very often but on my CodePen example only sparingly.

What I'm doing exactly: I have two endpoints for VAST responses - one internal source (which is often empty) and one external which I use when internal one fails. I need to request them from my domain so I manually fetch this endpoints and put response into IMA.

It goes like like this:

  1. User presses play or autoplay happens
  2. Video is paused - the issue is here, sometimes it keeps playing
  3. First VAST is fetch but it's empty
  4. Second VAST is fetched and put into IMA
  5. Ad is playing
  6. Ad is finished and video is resumed - when problem happens video is already in progress

I tried manually checking if ad is playing and pausing video if so but it doesn't fix the problem and breaks playback on iOS.

Reduced test case

https://codepen.io/davlasq/pen/RwOpJJV

Steps to reproduce

  1. Play video
  2. Video and ad are playing at the same time (video is not visible but you can hear audio)
  3. When ad ends video is already in progress
  4. Refresh if problem is not happening

Errors

No response

What version of Video.js are you using?

8.10.0

Video.js plugins used.

videojs-contrib-ads, videojs-ima

What browser(s) including version(s) does this occur with?

Chrome 122

What OS(es) and version(s) does this occur with?

Android 14

welcome[bot] commented 6 months ago

šŸ‘‹ Thanks for opening your first issue here! šŸ‘‹

If you're reporting a šŸž bug, please make sure you include steps to reproduce it. We get a lot of issues on this repo, so please be patient and we will get back to you as soon as we can. To help make it easier for us to investigate your issue, please follow the contributing guidelines.

mister-ben commented 5 months ago

The videojs-ima repo would be a better place to get help for this. https://github.com/googleads/videojs-ima/issues/1098 is possibly the same or related.

davlasq commented 5 months ago

Yes, this is the same issue. Thanks

davlasq commented 5 months ago

It looks like it's issue with IMA, i posted my workaround in previously mentioned issue.