c69f5d418432b1ef4822280983666fb98e5e1861
[gecko.git] / test_getUserMedia_basicAudio.html
blobc69f5d418432b1ef4822280983666fb98e5e1861
1 <!DOCTYPE HTML>
2 <html>
3 <head>
4 <script type="application/javascript" src="mediaStreamPlayback.js"></script>
5 </head>
6 <body>
7 <pre id="test">
8 <script type="application/javascript">
9 createHTML({ title: "getUserMedia Basic Audio Test", bug: "781534" });
10 /**
11 * Run a test to verify that we can complete a start and stop media playback
12 * cycle for an audio LocalMediaStream on an audio HTMLMediaElement.
14 runTest(function () {
15 var testAudio = createMediaElement('audio', 'testAudio');
16 var constraints = {audio: true};
18 return getUserMedia(constraints).then(stream => {
19 var playback = new LocalMediaStreamPlayback(testAudio, stream);
20 return playback.playMedia(false);
21 });
22 });
24 </script>
25 </pre>
26 </body>
27 </html>