-
Notifications
You must be signed in to change notification settings - Fork 7
Description
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:
- "Standard DVR" - All previous media in the live stream will be available to seek to and play for the life of the live stream (and perhaps after its completion).
- "Sliding Window DVR" - Previous media in the live stream will be removed over the life of the live stream, but a "sufficiently long amount" of the previous media will be available to seek and to play during the live stream's life. Most often, the duration of the seekable media content will stay roughly the same (with some margin of error changes, due to the segmented nature of HAS), except for cases where the live stream has just begun. We can think of this value, implicit in the live media stream itself, as the "Sliding Window Media Size", or the size of the sliding window, as determined from e.g. the media manifest/playlists themselves.
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 | nulltruemeans"standard"falsemeans"none" | "sliding"(where"sliding"is not within the scope of this proposal and therefore is "under-determined" by this value alone)nullmeans"unknown"- (implicit)
undefinedor not defined means unsupported
- Event Types:
"dvrchange"detail = dvr- Should be fired from the
HTMLMediaElementwheneverdvrchanges
Proposed 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 derive dvr. 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- All values correspond to their corresponding definitions, above.
- (implicit)
undefinedor not defined means unsupported
- Event Types:
"dvrchange"detail = dvr- Should be fired from the
HTMLMediaElementwheneverdvrchanges
HTMLMediaElement::get minSlidingWindow() {} : number- The minimum allowed seekable duration for media to definitively be considered
"sliding", akaHTMLMediaElement::seekable.end(0) - HTMLMediaElement::seekable.start(0) >= HTMLMediaElement::minSlidingWindow->HTMLMediaElement::dvr === "sliding" - Default Value: 60 (seconds)
- NOTE: We may want to consider an even larger value for default. This is the smallest value recommended to stay consistent with MPEG-DASH, HLS, and their corresponding official guidelines. For more, see the Google Doc, referenced above).
- The minimum allowed seekable duration for media to definitively be considered
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
- much easier to implement
- provides a definitive
true|falsefor both HLS and MPEG-DASH "immediately" (after loading and parsing the playlists/manifests once per media stream) - provides less ambiguous controversial definitions derivable from the HLS and MPEG-DASH specs
- doesn't have significant concerns for backwards compatibility if/when we introduce
"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).