Backed out changeset 4f5c09304792 (bug 1295352)

--HG--
extra : source : 0d2f0fcf7185290db6623557c66959e32b552c59
This commit is contained in:
Sebastian Hengst 2016-10-20 20:03:17 +02:00
Родитель d0d2db5cab
Коммит 971d25de22
6 изменённых файлов: 21 добавлений и 21 удалений

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

@ -32,11 +32,11 @@ MediaStreamPlayback.prototype = {
* @param {Boolean} isResume specifies if this media element is being resumed
* from a previous run
*/
playMedia : function(isResume) {
playMediaWithMediaStreamTracksStop : function(isResume) {
this.startMedia(isResume);
return this.verifyPlaying()
.then(() => this.stopTracksForStreamInMediaPlayback())
.then(() => this.detachFromMediaElement());
.then(() => this.stopMediaElement());
},
/**
@ -80,15 +80,15 @@ MediaStreamPlayback.prototype = {
/**
* Starts media with a media stream, runs it until a canplaythrough and
* timeupdate event fires, and detaches from the element without stopping media.
* timeupdate event fires, and stops the media.
*
* @param {Boolean} isResume specifies if this media element is being resumed
* from a previous run
*/
playMediaWithoutStoppingTracks : function(isResume) {
playMedia : function(isResume) {
this.startMedia(isResume);
return this.verifyPlaying()
.then(() => this.detachFromMediaElement());
.then(() => this.stopMediaElement());
},
/**
@ -156,12 +156,12 @@ MediaStreamPlayback.prototype = {
},
/**
* Detaches from the element without stopping the media.
* Stops the media with the associated stream.
*
* Precondition: The media stream and element should both be actively
* being played.
*/
detachFromMediaElement : function() {
stopMediaElement : function() {
this.mediaElement.pause();
this.mediaElement.srcObject = null;
}
@ -198,7 +198,7 @@ LocalMediaStreamPlayback.prototype = Object.create(MediaStreamPlayback.prototype
this.startMedia(isResume);
return this.verifyPlaying()
.then(() => this.deprecatedStopStreamInMediaPlayback())
.then(() => this.detachFromMediaElement());
.then(() => this.stopMediaElement());
}
},

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

@ -28,7 +28,7 @@
var testElem = createMediaElement('video', 'testAddTrackAudioVideo');
var playback = new LocalMediaStreamPlayback(testElem, stream);
return playback.playMedia(false);
return playback.playMediaWithMediaStreamTracksStop(false);
}))
.then(() => getUserMedia({video: true})).then(stream =>
getUserMedia({video: true}).then(otherStream => {
@ -44,7 +44,7 @@
var test = createMediaElement('video', 'testAddTrackDoubleVideo');
var playback = new LocalMediaStreamPlayback(test, stream);
return playback.playMedia(false);
return playback.playMediaWithMediaStreamTracksStop(false);
}))
.then(() => getUserMedia({video: true})).then(stream =>
getUserMedia({video: true}).then(otherStream => {
@ -81,7 +81,7 @@
stream.addTrack(track);
checkMediaStreamContains(stream, [track], "Re-added added-then-removed track");
var playback = new LocalMediaStreamPlayback(elem, stream);
return playback.playMedia(false);
return playback.playMediaWithMediaStreamTracksStop(false);
})
.then(() => otherTrack.stop());
}))
@ -99,7 +99,7 @@
var elem = createMediaElement('video', 'testAddRemoveOriginalTrackVideo');
var playback = new LocalMediaStreamPlayback(elem, audioStream);
return playback.playMedia(false);
return playback.playMediaWithMediaStreamTracksStop(false);
}))
.then(() => {
var ac = new AudioContext();

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

@ -87,7 +87,7 @@
]))
.then(() => playback.verifyPlaying()) // still playing
.then(() => playback.deprecatedStopStreamInMediaPlayback())
.then(() => playback.detachFromMediaElement());
.then(() => playback.stopMediaElement());
});
});

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

@ -60,7 +60,7 @@
]))
.then(() => playback.verifyPlaying()) // still playing
.then(() => playback.deprecatedStopStreamInMediaPlayback())
.then(() => playback.detachFromMediaElement());
.then(() => playback.stopMediaElement());
});
});

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

@ -36,7 +36,7 @@
info("Playing from track clones");
var test = createMediaElement('video', 'testClonePlayback');
var playback = new MediaStreamPlayback(test, clone);
return playback.playMedia(false);
return playback.playMediaWithMediaStreamTracksStop(false);
})
.then(() => getUserMedia({video: true})).then(stream =>
getUserMedia({video: true}).then(otherStream => {
@ -67,7 +67,7 @@
var test = createMediaElement('video', 'testClonePlayback');
var playback = new MediaStreamPlayback(test, streamClone);
return playback.playMedia(false)
return playback.playMediaWithMediaStreamTracksStop(false)
.then(() => stream.getTracks().forEach(t => t.stop()))
.then(() => stream.stop());
}))
@ -85,7 +85,7 @@
var test = createMediaElement('video', 'testClonePlayback');
var playback = new MediaStreamPlayback(test, inceptionClone);
return playback.playMedia(false);
return playback.playMediaWithMediaStreamTracksStop(false);
})
.then(() => getUserMedia({audio: true, video: true})).then(stream => {
info("Test adding tracks from many stream clones to the original stream");
@ -105,7 +105,7 @@
var test = createMediaElement('video', 'testClonePlayback');
var playback = new MediaStreamPlayback(test, stream);
return playback.playMedia(false);
return playback.playMediaWithMediaStreamTracksStop(false);
})
.then(() => {
info("Testing audio content routing with MediaStream.clone()");

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

@ -31,7 +31,7 @@
info("Testing playback of track clone");
var test = createMediaElement('video', 'testClonePlayback');
var playback = new MediaStreamPlayback(test, cloneStream);
return playback.playMedia(false);
return playback.playMediaWithMediaStreamTracksStop(false);
});
runTest(() => Promise.resolve()
@ -52,7 +52,7 @@
var test = createMediaElement('video', 'testClonePlayback');
var playback = new MediaStreamPlayback(test, cloneStream);
return playback.playMedia(false)
return playback.playMediaWithMediaStreamTracksStop(false)
.then(() => info("Testing that clones of ended tracks are ended"))
.then(() => cloneStream.clone().getTracks().forEach(t =>
is(t.readyState, "ended", "Track " + t.id + " should be ended")));
@ -73,7 +73,7 @@
var test = createMediaElement('video', 'testClonePlayback');
var playback = new MediaStreamPlayback(test, stream);
return playback.playMedia(false);
return playback.playMediaWithMediaStreamTracksStop(false);
})
.then(() => {
info("Testing audio content routing with MediaStreamTrack.clone()");