the durationchange event will be queued during the initialization segment received algorithm.
Only once the init segment has been fully processed will update/updateend be queued.
As such, the updateend event must be fired before being able to call appendBuffer once again.
MozReview-Commit-ID: GYQNOwWZ7DH
readyState is supposed to be updated during MSE's Initialization Segment Received and Coded Frame Processing algorithm.
Only then would the appendBuffer operation terminates by queueing the update/updateend events.
These tests ensure that loadedmetadata and loadeddata are fired first.
MozReview-Commit-ID: BJ5gISQRA7B
From the Segment Parser Loop definition:
https://w3c.github.io/media-source/index.html#sourcebuffer-segment-parser-loop
"2. If the input buffer contains bytes that violate the SourceBuffer byte stream format specification, then run the append error algorithm and abort this algorithm."
The test appends data with a valid init segment followed by corrupted content.
The corrupted content satisfies the condition that the input buffer contains bytes that violate byte stream format specification.
As such, the append error algorithm is to be run prior parsing the init segment.
Add a new test verifying the defined behavior.
The MP4 used in the tests was invalid:
1- It contains out of order and overlapping frames
2- The first frame for each of the first 9 media segments were marked as keyframe, even though they weren't
The new file was encoded such that:
- The total bitrate remains the same as in the previous files
- The total duration is similar
- Each media segment starts with a valid keyframe
- Frames are properly ordered
- GOP is made of 24 frames
- The video track doesn't start at 0, which helps testing the proper behaviour regarding buffered range calculation.
- Like in the previous video, the audio track is present but made of silence (which is puzzling for a video initially designed to test A/V sync)
The webm file presents the same characteristics.
MozReview-Commit-ID: 6AKKmInaenE
The data added in the sourcebuffer is very short (less than one second); it is possible that playback has completed prior the event being fired.
MozReview-Commit-ID: INHAFmEhSut
Should the events being waited for take a while to fire, we could have attempted to append more segments than the table contain causing an exception.
MozReview-Commit-ID: HnmLTqNQ5rb
Do not assume that the element is still seeking when the seeking event is actually fired (the seeking operation is asynchronous)
MozReview-Commit-ID: Ap24kUQK8R2
- No html document existed, preventing the test to run.
- Remove test related to the updating attribute being cleared: see https://github.com/w3c/media-source/issues/118
MozReview-Commit-ID: GxOBnr5mqyh
Audio track and video tracks have under most cases a different start and end time. Additionally, the mp4 file is poorly muxed and contains out of order frames. As such we keep a table of time and duration for each media segments.
The test itself was right, however it had an invalid time table to start with as it incorrectly used the dts (decode timestamp) instead of the pts (presentation timestamp).
MozReview-Commit-ID: G2uwK3rroj3
https://w3c.github.io/media-source/index.html#mediasource-attach: "If the resource fetch algorithm absolute URL matches the MediaSource object URL, ignore any preload attribute of the media element, skip any optional steps for when preload equals none"
A dummy URL or a revoked one no longer matches the MediaSource object URL, as such, the preload attribute isn't to be ignored.
MozReview-Commit-ID: EW5TOv9SSf
- The WebM file manifest correctly indicates the duration as reported in the metadata. However, the last frame has an end time 0f 6.05s which would adjust the duration. As such it is incorrect to assume that after a full appendBuffer the duration will remain the same as set in the metadata.
(source: https://w3c.github.io/media-source/index.html#sourcebuffer-coded-frame-processing "5. If the media segment contains data beyond the current duration, then run the duration change algorithm with new duration set to the maximum of the current duration and the group end timestamp")
- When setting the duration, the actual final duration may be different to what was set as it will be aligned to the highest end time
(source: https://w3c.github.io/media-source/index.html#duration-change-algorithm ("4.1 Update new duration to the highest end time reported by the buffered attribute across all SourceBuffer objects in sourceBuffers.")
MozReview-Commit-ID: EpzSaSg8pWW
The tests incorrectly assume that all videos start at 0. However this is often not the case, in particular for the mp4 files.
The buffered range is the intersection of the audio track and the video track. As such, if the video track starts at a later time than 0, the buffered range of the source buffer can't be starting at 0.
Rather than using different videos, we properly use the correct values; this is done to ensure that buffered range are calculated correctly, regardless of the video content.
timestamps verify with mkvinfo utility for webm and ffprobe for mp4.
See issue https://github.com/w3c/web-platform-tests/issues/1939
MozReview-Commit-ID: AMKgJHEJsWr
The seeking attribute is changed synchronously, however, the seeking event is fired asynchronously. It is possible that by the time the seeking event is fired, the seeking operation has already completed and that the "time marches on", causing currentTime to be past the seeking position.
MozReview-Commit-ID: IB83w6zKCLF
It is invalid to assume that no other actions can be performed between the time setTimout is called with a timeout value of 0 and the task actually runs.
This causes events to be regularly missed.
MozReview-Commit-ID: 70dtFsTwETf
See w3c/MSE Issue 19, 20 & 26.
Changing the duration now can never call the range removal algorithm. An explicit call to remove must be used for range removal.
This spec change performed the following:
- Require remove() for all Range Removals
MozReview-Commit-ID: 860PnQ9yrbc
It is incorrect to assume that the seeking attribute will still be true once the seeking event handler gets to run. Seeking may have completed between the time the seeking event was queued and the time the seeking env is fired.
MozReview-Commit-ID: CZFFotMyaIu
See w3c/MSE Issue 19, 20 & 26.
Changing the duration now can never call the range removal algorithm. An explicit call to remove must be used for range removal.
This spec change performed the following:
- Require remove() for all Range Removals
- Error on Duration Changes that need remove first
- Error on abort() during Range Removals
MozReview-Commit-ID: 1Xy8hi0tr7Q
I did a push with some logging. It looks like this test is currently just on
the border of the 10 second timeout, and sometimes gets killed by the timeout
mechanism before it can finish. Bumping up to 60.