blob: b5d1ed464a56e796d74af4598fc1be8ad3f68af3 [file] [log] [blame]
phoglund@webrtc.orgf1d6e0a2012-06-04 10:06:52 +00001<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
2<!--
3 Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
4
5 Use of this source code is governed by a BSD-style license
6 that can be found in the LICENSE file in the root of the source
7 tree. An additional intellectual property rights grant can be found
8 in the file PATENTS. All contributing project authors may
9 be found in the AUTHORS file in the root of the source tree.
10-->
11<html>
12<head>
13 <title>Single Local Preview (Audio Only)</title>
elham@webrtc.org90eb5c82013-03-05 19:53:01 +000014 <meta http-equiv="X-UA-Compatible" content="chrome=1"/>
15 <!-- Load the polyfill to switch-hit between Chrome and Firefox -->
16 <script src="adapter.js"> </script>
phoglund@webrtc.orgf1d6e0a2012-06-04 10:06:52 +000017 <script type="text/javascript">
18 function requestAudio() {
elham@webrtc.org90eb5c82013-03-05 19:53:01 +000019 getUserMedia({video: false, audio: true},
20 getUserMediaOkCallback,
21 getUserMediaFailedCallback);
phoglund@webrtc.orgf1d6e0a2012-06-04 10:06:52 +000022 }
23
24 function getUserMediaFailedCallback(error) {
25 alert("User media request denied with error code " + error.code);
26 }
27
28 function getUserMediaOkCallback(stream) {
elham@webrtc.org90eb5c82013-03-05 19:53:01 +000029 // Call the polyfill wrapper to attach the media stream to this element.
30 attachMediaStream(document.getElementById("audio1"), stream);
phoglund@webrtc.orgf1d6e0a2012-06-04 10:06:52 +000031 }
32 </script>
33</head>
34<body onload="requestAudio();">
35 <table border="0">
36 <tr>
37 <td>Sound test</td>
38 </tr>
39 <tr>
40 <td><audio id="audio1" autoplay="autoplay"></audio></td>
41 </tr>
42 </table>
43</body>
elham@webrtc.org90eb5c82013-03-05 19:53:01 +000044</html>