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: cloning algorithm: support for all possible srcObject types #156

Open
WofWca opened this issue May 17, 2023 · 0 comments
Open

fix: cloning algorithm: support for all possible srcObject types #156

WofWca opened this issue May 17, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@WofWca
Copy link
Owner

WofWca commented May 17, 2023

HTMLMediaElement.srcObject can be a MediaStream, MediaSource, Blob or File (see this). MediaSource could be handled by #2. The rest I have not checked whether the cloning algorithm works for them. Currently we're only copying the src attribute, which doesn't work if the media's source is set with srcObject:

const clone = document.createElement('audio');
this.clone = clone;
// TODO this probably doesn't cover all cases. Maybe it's better to just `originalElement.cloneNode(true)`?
// TODO also need to watch for changes of `crossOrigin`
// (in `ElementPlaybackControllerCloning.ts`).
clone.crossOrigin = originalElement.crossOrigin;
clone.src = originalElement.currentSrc;

@WofWca WofWca added the bug Something isn't working label May 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant