Replies: 2 comments 9 replies
-
High level I think this is 🔥. Just trying to think through some things. Since
At a high level, we could think of this as 2 different pieces: 1) A data contract; 2) A UI that "knows about" and is responsive to/can provide updates via (1). I have some additional thoughts/could throw out a few other straw men proposals, but wanted to start with some seed planting. |
Beta Was this translation helpful? Give feedback.
-
I have a slightly different proposal, for the media-playlist-items specifically. Instead just use media elements as the items, and media-playlist becomes a custom media element itself, encapsulating the logic of rotating medias internally. <media-controller>
<media-playlist slot="media">
<video src="...">
<audio src="..." preload="none">
<youtube-video src="..." preload="none">
</media-playlist>
</media-controller> This approach gets around any need for the playlist to understand differences between custom media elements. e.g. how do I handle a youtube source or text tracks? x-playist is a similar demo I built years ago and could be a starting place. The alt to that approach is to just build <media-controller>
<video src="..." slot="media">
<audio src="..." slot="media" preload="none">
<youtube-video src="..." slot="media" preload="none">
</media-controller> With either, we'll also need to standardize some events, like We might also consider the fact that the youtube player can go through a playlist itself, so a "next()" API might need to become a media-ui-extension. |
Beta Was this translation helpful? Give feedback.
-
Note: This isn't a Super Formal proposal, this is intended to be a "hey what if" and a test of using discussions for it 😅
The other day I needed to create a playlist, and it made me yearn for something like the
videojs-playlist
functionality. There would need to be quite a bit of thought around what the UI would look like for showing the playlist items, but to keep things simple assume this proposal is starting at just an auto-advancing playlist of media items.For the most simple use-case, my thought is that we can start with 4 new elements:
<media-playlist>
The parent element of all the playlist items (
<media-playlist-item>
). This element would also be where the playlist behavior was configured, such as autoadvancing, looping, pre-fetching behavior, etc.<media-playlist-item>
This gets a little weird, admittedly. In my mind this is mostly the same as a
<source>
tag, but should also accept things likeposter
.<media-playlist-previous-button>
Button to be used in the
control-bar
for returning to the previous playlist item.<media-playlist-next-button>
Button to be used in the
control-bar
for advancing to the next playlist item.Full example
Beta Was this translation helpful? Give feedback.
All reactions