Live DASH stream shouldn't wait on "seeking" event as it won't work with some streams.
Created by: jyavenard
The current DASH player when using live stream will first load an init segment, wait for the loadedmetadata event then seek toward the end and wait for the seeking event before loading media segments.
seeking is done by modifying the video element currentTime. Per spec: http://dev.w3.org/html5/spec-preview/media-elements.html#dom-media-seeking.
However, we should note that: step 7: "If the (possibly now changed) new playback position is not in one of the ranges given in the seekable attribute, then let it be the position in one of the ranges given in the seekable attribute that is the nearest to the new playback position. If two positions both satisfy that constraint (i.e. the new playback position is exactly in the middle between two ranges in the seekable attribute) then use the position that is closest to the current playback position. If there are no ranges given in the seekable attribute then set the seeking IDL attribute to false and abort these steps."
Note the last sentence: if the seekable attribute is empty, seeking algorithm will be aborted.
So to be able to seek, and have the seeking event fired, the video element seekable attribute must contain the value currentTime is set to.
Now looking at the spec for the HTMLMediaElement seekable attribute, when using MSE we have: https://w3c.github.io/media-source/#htmlmediaelement-extensions "
- If duration equals NaN: Return an empty TimeRanges object.
- If duration equals positive Infinity: 2a) If the HTMLMediaElement.buffered attribute returns an empty TimeRanges object, then return an empty TimeRanges object and abort these steps. 2b) Return a single range with a start time of 0 and an end time equal to the highest end time reported by the HTMLMediaElement.buffered attribute.
- Otherwise: Return a single range with a start time of 0 and an end time equal to duration. "
So if an init segment has a duration of infinity (or none defined), the media element seekable attribute will be empty as none of the source buffers contains any data.
I would expect most init segment in a live stream to have no duration set or a duration set to infinity. As such, when attempting to initially seek, it will immediately abort the seeking operation and the seeking event will never be fired.
This will cause the stream to never start as it will wait for a seeking event that will never come.
The DASH player should load the media element it needs, and seek to a position within the buffered range.