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

feat: split the _close method from mediaDetach #6966

Merged

Conversation

JackPu
Copy link
Contributor

@JackPu JackPu commented Jan 22, 2025

This PR will...

This PR aims to provide a _close method in the EME-Controller to prevent the clearing of the key session and reset data after detached media.

It will work for some FAST(free ad-supported streaming television) with one video element. Here is what we expected:

image

Here is a demo video:

1.22.mp4

CodePen Demo: https://codepen.io/Jack_Pu/pen/dPbgGGL

Why is this Pull Request needed?

We don't want to clear the key session and relate media keys. We can keep it until we force to destory it.

Are there any points in the code the reviewer needs to double check?

Resolves issues:

Checklist

  • changes have been done against master branch, and PR does not conflict
  • new unit / functional tests have been added (whenever applicable)
  • API or design changes are documented in API.md

@robwalch robwalch added this to the 1.6.0 milestone Jan 31, 2025
Comment on lines 1284 to +1286
private onMediaDetached() {
const media = this.media;
const mediaKeysList = this.mediaKeySessions;

Copy link
Collaborator

Choose a reason for hiding this comment

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

onMediaDetached has an event object of type MediaDetachedData that has an optional transferMedia property. This is used in Interstitials or custom applications performing gapless playback by transferring the MediaSource and its SourceBuffers to another player instance. In those cases would this change work just as well?

Copy link
Collaborator

Choose a reason for hiding this comment

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

If an issue comes up we can follow up with additional changes. Merging for v1.6.0-beta.3.

@robwalch robwalch merged commit 4e190d5 into video-dev:master Jan 31, 2025
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants