test_getUserMedia_playAudioTwice.html (714B)
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 Play Audio Twice", bug: "822109" }); 10 /** 11 * Run a test that we can complete an audio playback cycle twice in a row. 12 */ 13 runTest(function () { 14 return getUserMedia({audio: true}).then(audioStream => { 15 var testAudio = createMediaElement('audio', 'testAudio'); 16 var playback = new MediaStreamPlayback(testAudio, audioStream); 17 18 return playback.playMediaWithoutStoppingTracks(false) 19 .then(() => playback.playMedia(true)); 20 }); 21 }); 22 </script> 23 </pre> 24 </body> 25 </html>