Bug 1451149 - P2. Don't fire the "stalled" event when using MSE. r=bryce

When using a media element with a Media Source, the resource fetching algorithm is to be called in "local" mode:
https://www.w3.org/TR/media-source/#mediasource-attach
"Continue the resource fetch algorithm by running the remaining "Otherwise (mode is local)" steps, with these clarifications"

https://html.spec.whatwg.org/multipage/media.html#concept-media-load-resource
Under the local mode, the steps that would cause the element to fire suspend, stalled or progress can never occur.
We only prevent the stalled event to be fired, many websites rely on the progress event to be fired (such as when the init segment has been parsed). The HTML5 media spec will be amended to clearly indicate that progress is to be fired even with mediasource

MozReview-Commit-ID: DkoQzoV0JzO
This commit is contained in:
Jean-Yves Avenard
2018-05-14 11:32:09 +02:00
parent 0724cef7da
commit bedd0be107
2 changed files with 4 additions and 4 deletions

View File

@@ -5717,9 +5717,9 @@ HTMLMediaElement::CheckProgress(bool aHaveNewProgress)
}
if (now - mDataTime >= TimeDuration::FromMilliseconds(STALL_MS)) {
DispatchAsyncEvent(NS_LITERAL_STRING("stalled"));
if (mMediaSource) {
if (!mMediaSource) {
DispatchAsyncEvent(NS_LITERAL_STRING("stalled"));
} else {
ChangeDelayLoadStatus(false);
}