on my end the first clip that is played doesn't update media chrome state
Interesting. Can I see your test? It's working for me at least.
I did have issues with <youtube-video>, but I wasn't sure if that was a media-playlist issue or related to the youtube player load timing.
ideally media-playlist-item's should also support and
Yeah, confirmed, that's not working for me either. Must be a custom element loading issue. I'll dig into when I get a minute.
Separate note, @mmcc questioned why we don't just pull this into media-chrome. While it's a "media element" that can be used independently of media-chrome, I can see the argument. Interested in other opinions.
I think my concern is mostly around discoverability. I definitely don't think we should be merging muxinc/elements in here, to be clear, (I don't think that's what @heff was saying either, to be fair). I'm just feeling like it'd be nice to consolidate as much as we can just so someone can find all the cool stuff when they're digging through these docs.
For me there's a line with this project where, for it to be really useful long term, it does have UI elements associated with it. If we add those, do they go in that project? Or here? Thinking, for example, about previous/next type buttons, or a "what's next" type element.
If we add those, do they go in that project? Or here?
Here (media-chrome), because media-playlist won't be the only media element with playlist functionality. e.g. Youtube with player.nextVideo(). That makes it a media-ui-extensions detail to solve, but otherwise we've been pretty clear and consistent with the line between "chrome" and "media". While I feel like this is a special or supportive media element, it also feels like a slippery slope introducing media elements into media chrome. But the discoverability of the whole ecosystem, including other media elements, is something that's important to solve well.
Must be a custom element loading issue. I'll dig into when I get a minute.
Confirmed, the load order of media-playlist vs media-chrome scripts matters for some reason. Not clear why yet. If media playlist is loaded before media chrome, the problem happens. That feels backwards from what I'd expect.
could it be before this line document.createElement(playlistItem.getAttribute('type')); if it's a custom element we need to wait until it's defined? customElements.whenDefined()
or possibly upgrade it right after so the attributeCallback will be triggered when setting the attributes
https://developer.mozilla.org/en-US/docs/Web/API/CustomElementRegistry/upgrade
also make sure you attach the events before setting the attributes, though less important, loadstart will be delayed by a tick when setting the src.
I confirmed this is caused by https://github.com/muxinc/hls-video-element
if you add in my fork <script type="module" src="https://unpkg.com/@luwes/hls-video-element@0"></script> it works
maybe temporarily use just plain video and audio tags to get this example in?
(https://github.com/muxinc/media-playlist has a small bug where media.muted doesn't seem to work)