- add sources.
[platform/framework/web/crosswalk.git] / src / chrome / test / data / media / html / audio_record.html
1 <!-- Used by audio_playback_perf to verify audio recorded. -->
2 <!DOCTYPE html>
3 <html lang="en-US">
4   <head>
5     <title>Playback Test</title>
6   </head>
7   <body>
8     <audio autoplay preload controls></audio>
9   </body>
10   <script type="text/javascript">
11     var error = '';
12     function startTest(src) {
13       var audio = document.querySelector('audio');
14       audio.addEventListener('ended', function(evt) {
15         end(true);
16       }, false);
17       audio.addEventListener('error', function(evt) {
18         error = 'Error playing audio, code ' + evt.target.error.code;
19         end(false);
20       }, false);
21       // High volume can produce sound noise on some audio devices.  This value
22       // may not be significant if audio device volume is controlled externally.
23       audio.volume = 0.9;
24       audio.src = src;
25     }
26
27     function end(status) {
28       window.domAutomationController.send(status);
29     }
30   </script>
31 </html>