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

Video seeks to 0 when reaching the end with midrolls/postrolls with client side ads #4445

Closed
alarochelle opened this issue Aug 26, 2022 · 1 comment · Fixed by #4979
Closed
Labels
component: ads The issue involves the Shaka Player ads API or the use of other ad SDKs priority: P2 Smaller impact or easy workaround status: archived Archived and locked; will not be updated type: bug Something isn't working correctly
Milestone

Comments

@alarochelle
Copy link

alarochelle commented Aug 26, 2022

Have you read the FAQ and checked for duplicate open issues?
Yes

What version of Shaka Player are you using?
4.2.0

Can you reproduce the issue with our latest release version?
Yes

Can you reproduce the issue with the latest code from main?
Yes

Are you using the demo app or your own custom app?
Custom app

If custom app, can you reproduce the issue using our demo app?
Yes

What browser and OS are you using?
Chrome Version 104.0.5112.101 (Official Build) (x86_64) on MacOS 12.5.1

For embedded devices (smart TVs, etc.), what model and firmware version are you using?
N/A

What are the manifest and license server URIs?
Manifest: https://storage.googleapis.com/shaka-demo-assets/angel-one/dash.mpd
Ad tag URL: https://pubads.g.doubleclick.net/gampad/ads?iu=/21775744923/external/vmap_ad_samples&sz=640x480&cust_params=sample_ar%3Dpremidpost&ciu_szs=300x250&gdfp_req=1&ad_rule=1&output=vmap&unviewed_position_start=1&env=vp&impl=s&cmsid=496&vid=short_onecue&correlator=

What configuration are you using? What is the output of player.getConfiguration()?
Default

What did you do?
With client side ads.

  1. Start the content with the ad tag URL provided.
  2. Seek close to the end/to the end.
  3. Watch the midrolls and postrolls.
  4. When the video is done playing postrolls, it automatically seeks to the beginning.

This also happens without postrolls. As long as there are midrolls, the player will seek to 0 when reaching the end.
Seeking to the end again when all ads have completed will not seek to 0, the player will stay at the end, as expected.

What did you expect to happen?
The video should stay at the end and not restart automatically.

What actually happened?
Already described extensively above. I'm not sure why this happens, it seems like when the adStopped event happens, the player automatically seeks to 0. Could this be because a video.play() is called when an adStopped event happens? Not sure what the workarounds is here besides releasing/stopping the ad manager when all ads have completed or when the video element reaches the end.

@alarochelle alarochelle added the type: bug Something isn't working correctly label Aug 26, 2022
@github-actions github-actions bot added this to the v4.3 milestone Aug 26, 2022
@avelad avelad added component: ads The issue involves the Shaka Player ads API or the use of other ad SDKs priority: P2 Smaller impact or easy workaround labels Aug 26, 2022
@alarochelle
Copy link
Author

alarochelle commented Sep 7, 2022

Hi again! :)

This is actually a pretty important issue for us, and I can't seem to find a reliable workaround for it... any ideas?

@avelad avelad modified the milestones: v4.3, v4.4 Nov 11, 2022
theodab pushed a commit that referenced this issue Feb 9, 2023
After watching post roll ads, `this.video_.play()` was called on a completed content in the `onAdComplete` event.
The content would then restart from the beginning.

We now flag that the content is completed before we call `this.adsLoader_.contentComplete()`.
On the callback, we prevent the video element from replaying if this flag is set.

This fix is based on the Advanced Sample on the [googleads-ima-html5 repo](https://github.com/googleads/googleads-ima-html5/blob/main/advanced/ads.js#L128)

Closes #4445
joeyparrish pushed a commit that referenced this issue Feb 9, 2023
After watching post roll ads, `this.video_.play()` was called on a completed content in the `onAdComplete` event.
The content would then restart from the beginning.

We now flag that the content is completed before we call `this.adsLoader_.contentComplete()`.
On the callback, we prevent the video element from replaying if this flag is set.

This fix is based on the Advanced Sample on the [googleads-ima-html5 repo](https://github.com/googleads/googleads-ima-html5/blob/main/advanced/ads.js#L128)

Closes #4445

Backported to v3.2.x
joeyparrish pushed a commit that referenced this issue Feb 9, 2023
After watching post roll ads, `this.video_.play()` was called on a completed content in the `onAdComplete` event.
The content would then restart from the beginning.

We now flag that the content is completed before we call `this.adsLoader_.contentComplete()`.
On the callback, we prevent the video element from replaying if this flag is set.

This fix is based on the Advanced Sample on the [googleads-ima-html5 repo](https://github.com/googleads/googleads-ima-html5/blob/main/advanced/ads.js#L128)

Closes #4445
joeyparrish pushed a commit that referenced this issue Feb 9, 2023
After watching post roll ads, `this.video_.play()` was called on a completed content in the `onAdComplete` event.
The content would then restart from the beginning.

We now flag that the content is completed before we call `this.adsLoader_.contentComplete()`.
On the callback, we prevent the video element from replaying if this flag is set.

This fix is based on the Advanced Sample on the [googleads-ima-html5 repo](https://github.com/googleads/googleads-ima-html5/blob/main/advanced/ads.js#L128)

Closes #4445
joeyparrish pushed a commit that referenced this issue Feb 9, 2023
After watching post roll ads, `this.video_.play()` was called on a completed content in the `onAdComplete` event.
The content would then restart from the beginning.

We now flag that the content is completed before we call `this.adsLoader_.contentComplete()`.
On the callback, we prevent the video element from replaying if this flag is set.

This fix is based on the Advanced Sample on the [googleads-ima-html5 repo](https://github.com/googleads/googleads-ima-html5/blob/main/advanced/ads.js#L128)

Closes #4445
@github-actions github-actions bot added the status: archived Archived and locked; will not be updated label Apr 10, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 10, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
component: ads The issue involves the Shaka Player ads API or the use of other ad SDKs priority: P2 Smaller impact or easy workaround status: archived Archived and locked; will not be updated type: bug Something isn't working correctly
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants