-
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
DVR State - Proposal #4
Comments
NOTE: Although I am recommending Proposal 1, particular decisions on the names or values may still be up for discussion. For example, we may want to model |
Thinking more about Assuming we always use manifest/playlist parsing as the source of truth for "Standard DVR," this means we know for sure whether or not a given media stream meets this condition. As such, we should not need to model the |
To me, an enum seems like the correct type, since there's potential multiple values. Plus, even if we ignore |
I believe if we have a single property that we intend to extend with new values, we run a greater risk of backwards compatibility, though we could account for that at an integration level. For example, using your proposal, in Media Chrome, we could start by treating any value that's not |
If we go this route, the initial implementation of
|
Another callout: All computation of what's described here as For example, Media Chrome can certainly (eventually) add some kind of support for inferring |
Re: "DVR" - Unless we can find a strong defense for "DVR" being a universally known term, we should find more accessible language. In proposal 2:
Does that then change as the seekable window changes? If not, what value is actually being used to compare against My counter proposal is:
Either we know up front that the seekable window is expected to be long enough or we don't. If it eventually gets long enough, I can tell that from seekable. I don't need this property to also reflect that. |
A couple of notes after an IRL conversation with @cjpillsbury: I think this property should be solely focused on what the media element can know initially (e.g. @cjpillsbury pointed out that we can know for certain that the stream will not be seekable, which my proposal doesn't cover. Here's a revised one:
If them media knows this live stream is not intended to be seekable, then it can set the window to zero. For the UI developer, the answer to "show progress bar?" is I currently like
It could be that the actual number of window duration is never useful or known. In which case maybe these should just all be string values (but then...we have to agree on names). I don't know the state of the world there. |
@heff Yup, that's exactly right. Was thinking specifically about this case based on your proposal, and I think there are actually some benefits to having this value available for the UI to consume, as long as it's treated as distinct from
This is effectively true for HLS, at least if we're trying to derive it from the playlists, since
That said, that may be fine, as long as we support changes over time (as briefly discussed, below) and/or explicitly add a setter for I think as long as we also assume it's valid that this value can change over time for a given media element's src (with a corresponding event, e.g. I do have one mild concern here, though I don't think it's sufficient to suggest an alternative. By having a single value here, this makes incremental support of this API slightly more likely to cause unanticipated UI changes for folks depending on this value. For example, if @gkatsev let me know if you have any concerns with this proposal. Otherwise, I'll plan on spiking on this approach. |
Any reason to incrementally support This seems like a reasonable solution. |
@gkatsev regardless of how we approach it for Open Elements, I think the concern still remains for other folks implementing this incrementally. |
I think what we should avoid is an API that might unexpectedly change the UI midstream. Connecting this to an event that's similar to Remind me how we know that an HLS playlist should definitely be standard live, not sliding? |
We will never know definitively from the playlists alone, as it's "underdetermined" wrt the spec. This is discussed in detail in the referenced google doc. We can plausibly make some safe assumptions for the vast majority of non-EVENT HLS live playlists (since the other scenarios are fairly non-standard) if we monitor either the sum of |
I'm not sure there's a reliable pre-existing event we can tie to here, since these values require fetching and (simple) parsing of the manifest/playlists. For playback engines wrapped in a web component, that means we'd have to assume we can derive these values in advance of the engine setting values on the |
NOTE: This proposal began as a subset of the Stream Type - Proposal #3 but was descoped due to complexities and the decision to model it as a separate state.
NOTE: A discussion on the complexities and permutations of "DVR", both using available HTTP Adaptive Streaming (HAS) manifests/playlists and inferring from the state of a given
HTMLMediaElement
instance can be found in this google doc, which also has comments enabled. Please read this document, as it provides relevant context for the proposal below.Overview and Purpose
A subset of "live streaming media" is intended to be played with seek capabilities for the viewer. This is frequently referred to as "DVR," and typically falls into one of two categories:
For both of these cases, although the media is live, the "intention" is to still allow users to seek through the media during playback.
Proposed DVR Types & Definitions
Below are the total possible DVR states (for more on why, see the Google Doc, referenced above).
"standard"
- The media stream is live and all previous media content will be available"sliding"
- The media stream is live and a sufficient amount of previous media content will be available for seeking"none"
- The media stream is on-demand, or the media stream is live and there will not be a sufficient amount of previous media content available for seeking."any"
- The media stream is live and is either"standard"
or"sliding"
, but it is (currently) ambiguous which of these two it is."unknown"
- There is no media stream, or the media stream is live, but it is (currently) ambiguous if it's"none"
(no DVR),"standard"
,"sliding"
, or"any"
.undefined
- The DVR feature is unimplemented by the media element.Proposed Interface 1 (narrow implementation -
"standard"
support only)This version of the proposal intentionally omits/"doesn't solve for" any account of
"sliding"
.HTMLMediaElement::get dvr() {} : boolean | null
true
means"standard"
false
means"none" | "sliding"
(where"sliding"
is not within the scope of this proposal and therefore is "under-determined" by this value alone)null
means"unknown"
undefined
or not defined means unsupported"dvrchange"
detail = dvr
HTMLMediaElement
wheneverdvr
changesProposed Inferring 1 (narrow implementation -
"standard"
support only)Only rely on HLS playlist (
EXT-X-PLAYLIST-TYPE:EVENT
) or MPEG-DASH manifest (MPD@type="dynamic && !MPD@timeShiftBufferDepth
) parsing to derivedvr
. Any other process will result in ambiguities. For more, see the Google Doc, referenced above.Proposed Interface 2 (exhaustive)
type DVRType = "standard" | "sliding" | "none" | "any" | "unknown"
HTMLMediaElement::get dvr() {} : DVRType
undefined
or not defined means unsupported"dvrchange"
detail = dvr
HTMLMediaElement
wheneverdvr
changesHTMLMediaElement::get minSlidingWindow() {} : number
"sliding"
, akaHTMLMediaElement::seekable.end(0) - HTMLMediaElement::seekable.start(0) >= HTMLMediaElement::minSlidingWindow
->HTMLMediaElement::dvr === "sliding"
HTMLMediaElement::set minSlidingWindow(value: number) {} : void
Proposed Inferring 2 (exhaustive)
To be documented formally if this is the preferred adopted proposal. Most of this may be determined from the Google Doc, referenced above.
Recommendation: Proposal 1 (narrow implementation -
"standard"
support only)Reasons for recommendation
true|false
for both HLS and MPEG-DASH "immediately" (after loading and parsing the playlists/manifests once per media stream)"sliding"
(and corresponding "uncertain" states such as"any"
or"unknown"
in the case of early stream starts). This is because any implementations that add a future"sliding"
support (assuming new properties are introduced) will simply treat these as"live"
unless/until they integrate with the new interface. This feels far less risky than the other way around, where"live"
streams would suddenly and unexpectedly start showing up as "DVR" (seekable).The text was updated successfully, but these errors were encountered: