Bug: mux-video with hls: Error: Media element src was set while attaching MediaSource when adding tracks
Is there an existing issue for this?
- [X] I have searched the existing issues
Which Mux Elements/Packages does this apply to? Select all that apply
mux-video
Which browsers are you using?
Chrome
Which operating systems are you using?
macOS
Description
I'm getting an error when supplying tracks to the mux-video web component.
[error] > Media element src was set while attaching MediaSource Here's some example code:
<mux-video src="https://some-hls-source"
The code I'm using in my component is more complex than this and involves the use of media-chrome, but even when I use straight up HTML without my wrapper component and the hosted version of mux-video it still occurs.
There's no documentation on the mux-video readme about
How do I provide the captions, chapters etc without triggering this error?
Reduced test case
https://codepen.io/endymion1818/pen/RwmKQpq
Steps to reproduce
- Load the page
- See error in console
Current Behavior
An error is logged to the console although player renders and works as expected.
Expected Behavior
No error logged to the console.
Errors
[error] > Media element src was set while attaching MediaSource
What version of the package are you using?
v0.19.0
It looks like it could be a race condition because tracks need to download their src files asynchronously yet the player seems to render straight away
I see the error but does this break anything in your program? seems the captions still work as expected.
it's a strange error because the media element is different from the track element. https://github.com/video-dev/hls.js/pull/5206/files
seems almost like that event bubbles up or something and the track src is wrongly compared with the media element src which is a blob.
It doesn't break you're right, but we get a console error on each load, which is going to be a drain on our bug tracker. It will cause similar issues for third parties that embed our player too so we really want to avoid it if at all possible.
totally get that. how I see it currently is that it's a bug in hls.js, could you open an issue there and mention this ticket? we'll follow it along.
Thanks, I'm opening an issue there however some information I don't think I have access to: what is the hls.js configuration?
Also I've developed a new test case that outputs more information to the console, is this information more helpful? https://embed-mediamanager-io-v3.pages.dev/storybook/?path=/story/media-manager-embeds--player
Hi! Thanks for reporting this. I was able to reproduce the issue using the version you mentioned, but it no longer seems to occur with the latest release (v0.24.5).
Could you try updating to a more recent version and see if the issue still happens on your end?
I'll go ahead and close this for now, but feel free to reopen it if you have any additional information or if the issue persists.
Thanks again!
Thanks Renzo, we have upgraded dependencies on the app and it seems to work great! Thank you!