From 988d99e20f1844db989339c8bb4dfa50905459b8 Mon Sep 17 00:00:00 2001
From: Noam Rosenthal A media resource has an associated
origin, which is either "none
",
"multiple
", "rewritten
", or an
- origin.none
".
+ origin. It is initially set to "none
".
A media resource can have multiple audio and video tracks. For the purposes of a media element, the video data of the media resource is only that of the @@ -34495,13 +34496,15 @@ interface MediaError {
To verify a media response given a response - response, a media resource resource and a Null or - (number, Null or number) optionalByteRange:
+ response, a media resource resource and + "entire resource
" or (number, number or "until end
")
+ optionalByteRange:
If response is a network error, return false.
If optionalByteRange is null, return true.
If optionalByteRange is "entire resource
", return
+ true.
Let internalResponse be response's unsafe response.
If any of the following conditions are true:
none
none
"rewritten
"Let (start, end) be the result of - extracting content range from + extracting content-range values from internalResponse.
If start is not optionalByteRange[0], or if - optionalByteRange[1] is neither null or end, return false.
until end
" or end,
+ return false.
Return true.
Let destination be "audio
" if the media
- element is an audio
element and to "video
"
+ element is an audio
element, or "video
"
otherwise.
Let request be the result of MediaError { media element's node document's relevant settings object.
Let optionalByteRange, which is Null or (number, Null or number) be - the byte range required to satisfy missing data in media data. This value is - implementation-defined and may rely on codec, network conditions or other - heuristics. The user-agent may determine to fetch the resource in full, in which case - optionalByteRange would be null.
Let optionalByteRange, which is "entire resource
" or
+ (number, number or "until end
") be the byte range required to satisfy
+ missing data in media data. This value is implementation-defined
+ and may rely on codec, network conditions or other heuristics. The user-agent may determine
+ to fetch the resource in full, in which case optionalByteRange would be
+ "entire resource
", to fetch from a byte offset until the end,
+ in which case optionalByteRange would be
+ (number, "until end
"), or to fetch a range between two byte offsets,
+ im which case optionalByteRange (number, number) representing the two
+ offsets.
If optionalByteRange is not null, then add a range header to request given optionalByteRange[0] and @@ -34641,17 +34650,45 @@ interface MediaError {
Fetch request, with processResponseEndOfBody given response set to - finalize and report timing with response, - the media element's node document's - relevant global object, and destination + and processResponse set to the following steps given response response:
Let global be the media element's + node document's relevant global object.
Let updateMedia be to queue a media element task given + the media element to run the first appropriate steps from the + media data processing steps list below. (A new task is used for + this so that the work described below occurs relative to the appropriate + media element event task source rather than using the + networking task source.)
+ +Let finalize be to finalize and report timing with + response, global, and destination, and call + updateMedia.
Let processEndOfMedia be the following steps:
+ +Call finalize.
+ +If the fetching process has completes without errors, including decoding the + media data, and if all of the data is available to the user agent without network + access, then, the user agent must move on to the final step below. + This might never happen, e.g. when streaming an infinite resource such as web radio, or + if the resource is longer than the user agent's ability to cache data.
+If the result of verifying response given the current media resource and - optionalByteRange is false, then set response to a new - network error.
Update media data with the contents of response's
unsafe response obtained in this fashion. response can be
@@ -34718,21 +34755,6 @@ interface MediaError {
given the media element to fire an
event named progress
at the element.
The networking task source tasks to - process the data as it is being fetched must each immediately queue a - media element task given the media element to run the first appropriate - steps from the media data processing steps list below. (A new task is used for - this so that the work described below occurs relative to the appropriate media element - event task source rather than using the networking task source.)
- -When the networking task source has queued the last task as part of fetching the - media resource (i.e. once the download has completed), if the fetching process - completes without errors, including decoding the media data, and if all of the data is available - to the user agent without network access, then, the user agent must move on to the final step below. - This might never happen, e.g. when streaming an infinite resource such as web radio, or if the - resource is longer than the user agent's ability to cache data.
-While the user agent might still need network access to obtain parts of the media resource, the user agent must remain on this step.