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

fix: Prevent content from being restarted after Postroll ads #4979

Merged

Conversation

gingman
Copy link
Contributor

@gingman gingman commented Feb 8, 2023

Fixes #4445

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

@google-cla
Copy link

google-cla bot commented Feb 8, 2023

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@gingman gingman changed the title fix(IMA): Prevent content from being restarted after Postroll ads fix: Prevent content from being restarted after Postroll ads Feb 8, 2023
@avelad
Copy link
Member

avelad commented Feb 8, 2023

@gingman can you sign the CLA? Thanks!

@gingman
Copy link
Contributor Author

gingman commented Feb 8, 2023

@avelad done. The check is now green.

@avelad avelad added type: bug Something isn't working correctly 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 Feb 8, 2023
@avelad avelad added this to the v4.4 milestone Feb 8, 2023
@github-actions
Copy link
Contributor

github-actions bot commented Feb 8, 2023

Incremental code coverage: 0.00%

lib/ads/client_side_ad_manager.js Outdated Show resolved Hide resolved
@theodab theodab merged commit 64e94f1 into shaka-project:main Feb 9, 2023
@theodab
Copy link
Contributor

theodab commented Feb 9, 2023

Thanks for your contribution!

@gingman gingman deleted the fix/ima-content-resume-after-postroll branch February 9, 2023 14:37
joeyparrish pushed a commit that referenced this pull request 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 pull request 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 pull request 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 pull request 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 Jul 25, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 25, 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 this pull request may close these issues.

Video seeks to 0 when reaching the end with midrolls/postrolls with client side ads
3 participants