Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(146)

Side by Side Diff: ppapi/examples/media_stream_audio/media_stream_audio.html

Issue 140783004: [PPAPI] Pepper MediaStream API audio track implementation and example. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix review issues Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ppapi/examples/media_stream_audio/media_stream_audio.cc ('k') | ppapi/ppapi_proxy.gypi » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <html> 2 <html>
3 <!-- 3 <!--
4 Copyright 2014 The Chromium Authors. All rights reserved. 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 5 Use of this source code is governed by a BSD-style license that can be
6 found in the LICENSE file. 6 found in the LICENSE file.
7 --> 7 -->
8 <head> 8 <head>
9 <title>Media Stream Video Example</title> 9 <title>Media Stream Audio Example</title>
10 <script type="text/javascript"> 10 <script type="text/javascript">
11 var plugin; 11 var plugin;
12 var stream; 12 var stream;
13 13
14 function handleMessage(message) { 14 function handleMessage(message) {
15 console.log(message); 15 console.log(message);
16 } 16 }
17 17
18 function success(s) { 18 function success(s) {
19 stream = s; 19 stream = s;
20 plugin.postMessage({track: stream.getVideoTracks()[0]}); 20 plugin.postMessage({track: stream.getAudioTracks()[0]});
21 } 21 }
22 22
23 function failure(e) { 23 function failure(e) {
24 console.log(e); 24 console.log(e);
25 } 25 }
26 26
27 function initialize() { 27 function initialize() {
28 plugin = document.getElementById('plugin'); 28 plugin = document.getElementById('plugin');
29 plugin.addEventListener('message', handleMessage, false); 29 plugin.addEventListener('message', handleMessage, false);
30 var constraints = { 30 navigator.webkitGetUserMedia({ 'audio': true }, success, failure);
31 "audio": false,
32 "video": {
33 "mandatory": {
34 "minWidth": "1280",
35 "minHeight": "720",
36 "minFrameRate": "30"
37 },
38 "optional": []
39 }
40 };
41 navigator.webkitGetUserMedia(constraints, success, failure);
42 } 31 }
43 32
44 document.addEventListener('DOMContentLoaded', initialize, false); 33 document.addEventListener('DOMContentLoaded', initialize, false);
45 </script> 34 </script>
46 </head> 35 </head>
47 36
48 <body> 37 <body>
49 <h1>Pepper MediaStream Video API Example</h1><br> 38 <h1>Pepper MediaStream Audio API Example</h1><br>
50 This example demonstrates receiving frames from a video MediaStreamTrack and 39 This example demonstrates receiving frames from an audio MediaStreamTrack and
51 rendering them in a plugin.<br> 40 rendering them in a plugin.<br>
52 <embed id="plugin" type="application/x-ppapi-example-media-stream-video" 41 <embed id="plugin" type="application/x-ppapi-example-media-stream-audio"
53 width="320" height="240"/> 42 width="320" height="240"/>
54 </body> 43 </body>
55 </html> 44 </html>
OLDNEW
« no previous file with comments | « ppapi/examples/media_stream_audio/media_stream_audio.cc ('k') | ppapi/ppapi_proxy.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698