Bug 1103188 - Always check tracks on getUserMedia(). r=jib

This commit is contained in:
Andreas Pehrson 2015-09-30 09:32:06 +08:00
parent 3a7c0110d4
commit b8e127d6c1
8 changed files with 2 additions and 14 deletions

View File

@ -215,7 +215,8 @@ function createMediaElement(type, label) {
*/
function getUserMedia(constraints) {
info("Call getUserMedia for " + JSON.stringify(constraints));
return navigator.mediaDevices.getUserMedia(constraints);
return navigator.mediaDevices.getUserMedia(constraints)
.then(stream => (checkMediaStreamTracks(constraints, stream), stream));
}
// These are the promises we use to track that the prerequisites for the test

View File

@ -83,7 +83,6 @@ scriptsReady
var constraints = {audio: {mediaSource: "audioCapture"}};
return getUserMedia(constraints).then((stream) => {
checkMediaStreamTracks(constraints, stream);
window.grip = stream;
var analyser = new AudioStreamAnalyser(ac, stream);
analyser.enableDebugCanvas();

View File

@ -16,8 +16,6 @@
var constraints = {audio: true};
return getUserMedia(constraints).then(stream => {
checkMediaStreamTracks(constraints, stream);
var playback = new LocalMediaStreamPlayback(testAudio, stream);
return playback.playMedia(false);
});

View File

@ -30,8 +30,6 @@
};
return getUserMedia(constraints).then(stream => {
checkMediaStreamTracks(constraints, stream);
var playback = new LocalMediaStreamPlayback(testVideo, stream);
return playback.playMediaWithDeprecatedStreamStop(false);
});

View File

@ -19,8 +19,6 @@
var constraints = {video: true};
return getUserMedia(constraints).then(stream => {
checkMediaStreamTracks(constraints, stream);
var playback = new LocalMediaStreamPlayback(testVideo, stream);
return playback.playMedia(false);
});

View File

@ -19,8 +19,6 @@
var constraints = {video: true, audio: true};
return getUserMedia(constraints).then(stream => {
checkMediaStreamTracks(constraints, stream);
var playback = new LocalMediaStreamPlayback(testVideoAudio, stream);
return playback.playMedia(false);
});

View File

@ -19,8 +19,6 @@
var constraints = {video: true};
return getUserMedia(constraints).then(stream => {
checkMediaStreamTracks(constraints, stream);
var playback = new LocalMediaStreamPlayback(testVideo, stream);
var video = playback.mediaElement;

View File

@ -30,8 +30,6 @@
};
return getUserMedia(constraints).then(stream => {
checkMediaStreamTracks(constraints, stream);
var playback = new LocalMediaStreamPlayback(testVideo, stream);
return playback.playMediaWithDeprecatedStreamStop(false);
});