Bug 1362165: P4. Don't assume the duration found when reading metadata will be the final one. r=gerald

When endOfStream() is called, the duration is changed to that of the last buffered frame's end time.

The ended event will only be fired if currentTime is equal to the duration. So if the duration has changed following a call to endOfStream, then playback won't be considered as ended.

MozReview-Commit-ID: DBu3LorwFTI

--HG--
extra : rebase_source : a721ac0186f609b23537b71819c63d812f89a3b6
This commit is contained in:
Jean-Yves Avenard 2017-04-28 16:16:51 +02:00
Родитель 3b95392a3c
Коммит 6643614f8c
1 изменённых файлов: 1 добавлений и 1 удалений

Просмотреть файл

@ -20,7 +20,7 @@ runWithMSE(function(ms, el) {
// Test 'ended' is fired when seeking to the end of the media
// once the duration is known.
el.onloadedmetadata = () => {
ms.onsourceended = () => {
el.currentTime = el.duration;
};
el.addEventListener("ended", SimpleTest.finish.bind(null));