[iOS] Muted media playback can interrupt out-of-process audio
[WebKit-https.git] / Tools / TestWebKitAPI / Tests / WebKitLegacy / ios / video-with-paused-audio-and-playing-muted.html
1 <!DOCTYPE html>
2 <html>
3     <head>
4         <script>
5         function go() {
6             var video1 = document.createElement('video');
7             document.body.appendChild(video1);
8             video1.setAttribute('webkit-playsinline', '');
9             video1.src = 'video-with-audio.mp4';
10             video1.play().then(() => {
11                 video1.pause();
12                 var video2 = document.createElement('video');
13                 document.body.appendChild(video2);
14                 video2.setAttribute('webkit-playsinline', '');
15                 video2.muted = true;
16                 video2.src = 'video-with-audio.mp4';
17                 video2.play().then(playing, notPlaying);
18             });
19         }
20
21         function playing() {
22             try {
23                 window.webkit.messageHandlers.testHandler.postMessage('playing');
24             } catch(e) {
25                 window.location = 'callback:playing';
26             }
27         }
28
29         function notPlaying() {
30             try {
31                 window.webkit.messageHandlers.testHandler.postMessage('not playing');
32             } catch(e) { }
33         }
34         </script>
35     </head>
36     <body onload="go()">
37     </body>
38 </html>