Android NTP: Most visited tile clicks should have PageTransition.AUTO_BOOKMARK
[chromium-blink-merge.git] / ppapi / examples / media_stream_audio / media_stream_audio.html
blob6513ccdfa10c6b8918a4d696255010092bd895e6
1 <!DOCTYPE html>
2 <html>
3 <!--
4 Copyright 2014 The Chromium Authors. All rights reserved.
5 Use of this source code is governed by a BSD-style license that can be
6 found in the LICENSE file.
7 -->
8 <head>
9 <title>Media Stream Audio Example</title>
10 <script type="text/javascript">
11 var plugin;
12 var stream;
14 function handleMessage(message) {
15 console.log(message);
18 function success(s) {
19 stream = s;
20 plugin.postMessage({track: stream.getAudioTracks()[0]});
23 function failure(e) {
24 console.log(e);
27 function initialize() {
28 plugin = document.getElementById('plugin');
29 plugin.addEventListener('message', handleMessage, false);
30 navigator.webkitGetUserMedia({ 'audio': true }, success, failure);
33 document.addEventListener('DOMContentLoaded', initialize, false);
34 </script>
35 </head>
37 <body>
38 <h1>Pepper MediaStream Audio API Example</h1><br>
39 This example demonstrates receiving frames from an audio MediaStreamTrack and
40 rendering them in a plugin.<br>
41 <embed id="plugin" type="application/x-ppapi-example-media-stream-audio"
42 width="320" height="240"/>
43 </body>
44 </html>