Bug 1423241 - Hold back readyState while no frame has been displayed as intended. r=jya

HasVideo() might be false even though there is a video track present as it will
only look at the resolution of a VideoTrack.

Differential Revision: https://phabricator.services.mozilla.com/D9103
This commit is contained in:
Andreas Pehrson
2018-11-23 15:01:24 +00:00
parent aa36cf76cb
commit 0d7bdfee9a

View File

@@ -6070,8 +6070,10 @@ HTMLMediaElement::UpdateReadyStateInternal()
return;
}
if (IsVideo() && HasVideo() && !IsPlaybackEnded() && GetImageContainer() &&
!GetImageContainer()->HasCurrentImage()) {
if (IsVideo() &&
VideoTracks() && !VideoTracks()->IsEmpty() &&
!IsPlaybackEnded() &&
GetImageContainer() && !GetImageContainer()->HasCurrentImage()) {
// Don't advance if we are playing video, but don't have a video frame.
// Also, if video became available after advancing to HAVE_CURRENT_DATA
// while we are still playing, we need to revert to HAVE_METADATA until