mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-28 12:45:27 +00:00
550f159197
--HG-- extra : transplant_source : %E1%81%12%9A%0D%C0%A6%DF%21%84o%06%7E1%40%1E%93%97%2Ag
40 lines
1.3 KiB
HTML
40 lines
1.3 KiB
HTML
<!DOCTYPE HTML>
|
|
<html>
|
|
<head>
|
|
<script type="application/javascript" src="mediaStreamPlayback.js"></script>
|
|
</head>
|
|
<body>
|
|
<pre id="test">
|
|
<script type="application/javascript">
|
|
createHTML({title: "getUserMedia within getUserMedia", bug: "822109" });
|
|
/**
|
|
* Run a test that we can complete a playback cycle for a video,
|
|
* then upon completion, do a playback cycle with audio, such that
|
|
* the audio gum call happens within the video gum call.
|
|
*/
|
|
runTest(function () {
|
|
return getUserMedia({video: true})
|
|
.then(videoStream => {
|
|
var testVideo = createMediaElement('video', 'testVideo');
|
|
var videoPlayback = new LocalMediaStreamPlayback(testVideo,
|
|
videoStream);
|
|
|
|
return videoPlayback.playMedia(false)
|
|
.then(() => getUserMedia({audio: true}))
|
|
.then(audioStream => {
|
|
var testAudio = createMediaElement('audio', 'testAudio');
|
|
var audioPlayback = new LocalMediaStreamPlayback(testAudio,
|
|
audioStream);
|
|
|
|
return audioPlayback.playMedia(false)
|
|
.then(() => audioStream.stop());
|
|
})
|
|
.then(() => videoStream.stop());
|
|
});
|
|
});
|
|
|
|
</script>
|
|
</pre>
|
|
</body>
|
|
</html>
|