-
Notifications
You must be signed in to change notification settings - Fork 8
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
Playback quality selection #1
Comments
Also wanted to mention https://github.com/videojs/videojs-contrib-quality-levels which we wrote with making it be updated to a spec in mind. |
Amending the With the wide variety of bitrate ladders out in the wild, having For more advanced use cases, it may also be necessary to dispatch events so that changes made to the renditions list can be reflected in the UI:
One possible alternative, though certainly not as simple, would be something similar to the existing text/audio/video track APIs: partial interface VideoTrack {
readonly attribute VideoRenditionList renditions;
};
interface VideoRenditionList : EventTarget {
readonly attribute unsigned long length;
getter VideoRendition (unsigned long index);
VideoRendition? getRenditionById(DOMString id);
readonly attribute long selectedIndex;
attribute EventHandler onchange;
attribute EventHandler onaddrendition;
attribute EventHandler onremoverendition;
};
interface VideoRendition {
readonly attribute DOMString id;
readonly attribute unsigned long width;
readonly attribute unsigned long height;
readonly attribute unsigned long bitrate;
readonly attribute unsigned long codec;
attribute boolean selected;
}; |
We're stepping into this with media-chrome, and it looks like @luwes has already done work on a version. How should mixed audio/video renditions (.ts HLS) be handled in an API like this? Should the assumption be if there's no audio renditions then there's only mixed media renditions? Or should the rendition list not be media type specific, with a rendition type field that can be video/audio/mixed. I think I remember a proposal from @wilaw somewhere with those options. |
Yes, good food for thought. @cjpillsbury brought this also up when we discussed my draft implementation. Maybe it'd be easier to not have to patch the would be more like partial interface HTMLMediaElement {
readonly attribute RenditionList renditions;
}
interface RenditionList : EventTarget {
readonly attribute unsigned long length;
getter Rendition (unsigned long index);
Rendition? getRenditionById(DOMString id);
readonly attribute long selectedIndex;
attribute EventHandler onchange;
attribute EventHandler onaddrendition;
attribute EventHandler onremoverendition;
};
interface Rendition {
readonly attribute DOMString trackId;
readonly attribute video | audio | mixed type;
readonly attribute DOMString id;
readonly attribute unsigned long width;
readonly attribute unsigned long height;
readonly attribute unsigned long bitrate;
readonly attribute unsigned long codec;
attribute boolean selected;
}; |
The multiple video tracks use case is one to consider here. On one hand, it means you'll still end up identifying which video track a rendition belongs to. On the other hand, I question how much we can rely on the native VideoTracks list to actually represent the multiple video tracks in an adaptive manifest. If it doesn't, then that makes it more complicated to extend the native VideoTracks in the (maybe rare) use case of multiple video tracks with multiple renditions each. Anybody have experience with that or want to test it? |
There is poor (none that I know of) support of "alternate video" in native playback for browser/browser-like envs (and players generally). However, there is decent support for "alternate audio". |
I think there are two things to consider here:
For an API we can use today, not having to extend Audio/Video Tracks is definitely nice, but I think such an API is less likely to get accepted into the relevant specs. I think that adding a RenditionList to Audio and Video Tracks, similar to what @littlespex prposed above, is better than a combined RenditionList. In the majority case, since alternative video tracks aren't very common, you'd end up with a single Video Track, which has the specified The tricky part of a renditions API is likely supporting everything that DASH allows. DASH is tricky here because you can have different renditions per period and potentially different audio tracks per video track. Maybe a non-goal would be to not support all permutations that DASH allows. HLS is simpler because it doesn't allow you multiple renditions per audio track. |
I'd be careful here. Folks definitely use
(note the shared and when playing in Safari, you'll get: (aka a single Additionally, no "Languages" control menu is added to the controls, since there is only one "track". Compare to this example https://storage.googleapis.com/shaka-demo-assets/angel-one-hls/hls.m3u8 which includes:
Note that they all share the same And here's what shows up in the automatically added "Language" control menu: Finally, here's what happens when I create a local version of the multivariant playlist where the two english
(note there's only one All this is to say that Safari will treat multiple audio playlists as different tracks or as the same track depending on details in their attributes |
However, this will still only match a specific audio track to a specific set of video renditions. The audio renditions won't be switching independently of the video renditions here, which is specifically what I was calling out, maybe it wasn't clear enough. I tested locally and as far as I can tell, Safari is ignoring the second English track (I just named all the tracks English). |
"ignoring" may be wrong here. iirc AVFoundation/AVPlayer (which Safari HLS playback is built on top of) will do some filtering based on support (6 channels being relevant here) but will also use ABR switching, similar to video playlists, for multiple audio playlists with "similar relevant features". It just isn't exposed in the browser. |
Yeah, maybe it selects one from the available options and sticks with it. Either way, it seems simplified compared to what you can do in DASH. |
If it does ABR the audio renditions, I couldn't get it to happen. But maybe my test wasn't great. |
We don't have a good test stream. We'd want all the same container format & codec & channels with matching names & languages but notably different bitrates (including a stupidly large bitrate). We'd also likely want only one |
Or maybe someone with more knowledge of how this works under the hood will chime in 🤞 |
Allow a user to select from a set of video quality levels/resolutions/renditions/bitrates/variants/representations.
Was hoping to start this with a PR, but some research and discussion will be helpful first.
Related conversation: whatwg/html#562 from @dmlap
The proposed extension to VideoTrack seems promising.
Something to solve for is "auto".
Ping @gkatsev @littlespex
The text was updated successfully, but these errors were encountered: