Bug 1362165: P4. Don't assume the duration found when reading metadata will be the final one. r=gerald
authorJean-Yves Avenard <jyavenard@mozilla.com>
Fri, 28 Apr 2017 16:16:51 +0200
changeset 409396 5334cc6d0ea9b47325f4d6fcf4dab59307d12d55
parent 409395 bc1e56d5cb9ba2d563981973573cf3b10fc0abdb
child 409397 bb63055aef6c9842e8fa7370071eb22c9d2ecbc3
push id7391
push usermtabara@mozilla.com
push dateMon, 12 Jun 2017 13:08:53 +0000
treeherdermozilla-beta@2191d7f87e2e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgerald
bugs1362165
milestone55.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
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
dom/media/mediasource/test/test_EndedEvent.html
--- a/dom/media/mediasource/test/test_EndedEvent.html
+++ b/dom/media/mediasource/test/test_EndedEvent.html
@@ -15,17 +15,17 @@ SimpleTest.waitForExplicitFinish();
 runWithMSE(function(ms, el) {
   once(ms, 'sourceopen').then(function() {
     var sb = ms.addSourceBuffer("video/webm");
     fetchWithXHR("seek.webm", (buf) => sb.appendBuffer(new Uint8Array(buf)));
     sb.addEventListener("updateend", () => ms.endOfStream());
 
     // 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));
   });
 });
 
 </script>
 </pre>