Bug 1292621 - Call mozCapturedStreamXXX in onloadedmetadata callback. r=pehrsons. draft
authorChia-hung Tai <ctai@mozilla.com>
Mon, 15 Aug 2016 14:56:40 +0800
changeset 401028 ad786ba3036316dcf6d1f0e5cf4de5ae7eecf3f8
parent 401026 dd1ca2147e0e8842c7575ca20de329c2440a5282
child 528377 969b0a4667754e96635bfc738253018b96968855
push id26343
push userbmo:ctai@mozilla.com
push dateTue, 16 Aug 2016 05:45:59 +0000
reviewerspehrsons
bugs1292621
milestone51.0a1
Bug 1292621 - Call mozCapturedStreamXXX in onloadedmetadata callback. r=pehrsons. MozReview-Commit-ID: JRXtJyj94eW
dom/media/test/test_streams_autoplay.html
--- a/dom/media/test/test_streams_autoplay.html
+++ b/dom/media/test/test_streams_autoplay.html
@@ -15,17 +15,21 @@ SimpleTest.waitForExplicitFinish();
 
 var media = getPlayableVideo(gSmallTests);
 
 if (media == null) {
   todo(false, "No media supported.");
   SimpleTest.finish();
 } else {
   v1.src = media.name;
-  v2.srcObject = v1.mozCaptureStream();
+  v1.preload = 'metadata';
+  v1.onloadedmetadata = function() {
+    v2.srcObject = v1.mozCaptureStream();
+  };
+
   var onPlayingEventFired = false;
 
   v2.onplaying = function() {
     if(!onPlayingEventFired) {
       onPlayingEventFired = true;
       ok(true, "playback started");
       SimpleTest.finish();
     }