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(Ads): Limit interstitial duration to actual duration if available #7480

Merged
merged 2 commits into from
Oct 23, 2024

Conversation

avelad
Copy link
Member

@avelad avelad commented Oct 23, 2024

Currently, if the interstitial lasts 30 and we have a stream that lasts 31 seconds, we would go back to live after the interstitial, but with 1 extra second of latency. This PR solves this by limiting the play range to 30.

@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 Oct 23, 2024
@avelad avelad added this to the v4.12 milestone Oct 23, 2024
@avelad avelad force-pushed the interstitial-duration branch from 5ac4e55 to c4431ad Compare October 23, 2024 14:57
@shaka-bot
Copy link
Collaborator

shaka-bot commented Oct 23, 2024

Incremental code coverage: 75.00%

@@ -675,11 +675,25 @@ shaka.ads.InterstitialAdManager = class {
});
try {
this.updatePlayerConfig_();
// playRangeEnd in src= causes the ended event not to be fired when that
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't understand this comment in context of the next paragraph of code. Could you improve the comments in this whole try/catch? Happy to have a conversation about it if it helps you figure out what is missing from the comments.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For src= we use https://www.w3.org/TR/media-frags/ whose implementation in Safari implies that when the playRangeEnd time is reached, if the stream has not finished, what it does is pause the content, but does not emit the ended event.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IIUC, you are saying that this trick of using play range to limit the interstitial will not trigger an inappropriate 'ended' event, so we can then go back to the main content. Is that correct?

If that's right, I would add to this comment:

"So we can still return to the main content after that."

@avelad avelad merged commit ad9f2ac into shaka-project:main Oct 23, 2024
16 of 17 checks passed
@avelad avelad deleted the interstitial-duration branch October 24, 2024 06:35
avelad added a commit that referenced this pull request Oct 24, 2024
… when using src= (#7488)

Currently, if the interstitial lasts 30 and we have a stream that lasts
31 seconds, we would go back to live after the interstitial, but with 1
extra second of latency. This PR solves this by limiting the play range
to 30.

Related to #7480
avelad added a commit that referenced this pull request Oct 24, 2024
…#7480)

Currently, if the interstitial lasts 30 and we have a stream that lasts
31 seconds, we would go back to live after the interstitial, but with 1
extra second of latency. This PR solves this by limiting the play range
to 30.
avelad added a commit that referenced this pull request Oct 24, 2024
… when using src= (#7488)

Currently, if the interstitial lasts 30 and we have a stream that lasts
31 seconds, we would go back to live after the interstitial, but with 1
extra second of latency. This PR solves this by limiting the play range
to 30.

Related to #7480
avelad added a commit that referenced this pull request Oct 24, 2024
…#7480)

Currently, if the interstitial lasts 30 and we have a stream that lasts
31 seconds, we would go back to live after the interstitial, but with 1
extra second of latency. This PR solves this by limiting the play range
to 30.
avelad added a commit that referenced this pull request Oct 24, 2024
… when using src= (#7488)

Currently, if the interstitial lasts 30 and we have a stream that lasts
31 seconds, we would go back to live after the interstitial, but with 1
extra second of latency. This PR solves this by limiting the play range
to 30.

Related to #7480
avelad added a commit that referenced this pull request Oct 24, 2024
…#7480)

Currently, if the interstitial lasts 30 and we have a stream that lasts
31 seconds, we would go back to live after the interstitial, but with 1
extra second of latency. This PR solves this by limiting the play range
to 30.
avelad added a commit that referenced this pull request Oct 24, 2024
… when using src= (#7488)

Currently, if the interstitial lasts 30 and we have a stream that lasts
31 seconds, we would go back to live after the interstitial, but with 1
extra second of latency. This PR solves this by limiting the play range
to 30.

Related to #7480
@shaka-bot shaka-bot added the status: archived Archived and locked; will not be updated label Dec 22, 2024
@shaka-project shaka-project locked as resolved and limited conversation to collaborators Dec 22, 2024
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.

3 participants