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

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

Issue 11366038: Rewrite PPB_AudioInput_Dev to use the new-style host/resource. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 years, 1 month 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 | Annotate | Revision Log
OLDNEW
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <html> 2 <html>
3 <!-- 3 <!--
4 Copyright (c) 2012 The Chromium Authors. All rights reserved. 4 Copyright (c) 2012 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>Audio Input Example</title> 9 <title>Audio Input Example</title>
10 <script type="text/javascript"> 10 <script type="text/javascript">
(...skipping 23 matching lines...) Expand all
34 list.appendChild(list_item); 34 list.appendChild(list_item);
35 } 35 }
36 } 36 }
37 } 37 }
38 } 38 }
39 39
40 function UseDesignatedDevice(index) { 40 function UseDesignatedDevice(index) {
41 UseDevice(device_array[index], index); 41 UseDevice(device_array[index], index);
42 } 42 }
43 43
44 function UseDefaultDevice(use_0_1_interface) { 44 function UseDefaultDevice() {
45 var display_text = use_0_1_interface ? 'Default(v0.1)' : 'Default'; 45 UseDevice('Default', 'UseDefault');
46 var command = use_0_1_interface ? 'UseDefault(v0.1)' : 'UseDefault';
47 UseDevice(display_text, command);
48 } 46 }
49 47
50 function UseDevice(display_text, command) { 48 function UseDevice(display_text, command) {
51 var in_use_device = document.getElementById('in_use_device'); 49 var in_use_device = document.getElementById('in_use_device');
52 in_use_device.innerText = display_text; 50 in_use_device.innerText = display_text;
53 var plugin = document.getElementById('plugin'); 51 var plugin = document.getElementById('plugin');
54 plugin.postMessage(command); 52 plugin.postMessage(command);
55 53
56 var available_devices = document.getElementById('available_devices'); 54 var available_devices = document.getElementById('available_devices');
57 available_devices.parentNode.removeChild(available_devices); 55 available_devices.parentNode.removeChild(available_devices);
(...skipping 24 matching lines...) Expand all
82 80
83 <body> 81 <body>
84 <embed id="plugin" type="application/x-ppapi-example-audio-input" 82 <embed id="plugin" type="application/x-ppapi-example-audio-input"
85 width="800" height="400"/> 83 width="800" height="400"/>
86 <div style="margin-bottom:10px">In-use device: 84 <div style="margin-bottom:10px">In-use device:
87 <span id="in_use_device" style="font-weight:bold">None</span> 85 <span id="in_use_device" style="font-weight:bold">None</span>
88 </div> 86 </div>
89 <div id="available_devices"> 87 <div id="available_devices">
90 Available device(s), choose one to open: 88 Available device(s), choose one to open:
91 <ul id="device_list"> 89 <ul id="device_list">
92 <li><a href="javascript:UseDefaultDevice(true);"> 90 <li><a href="javascript:UseDefaultDevice();">
93 Default - use interface version 0.1</a></li>
94 <li><a href="javascript:UseDefaultDevice(false);">
95 Default - use interface version 0.2 and NULL device ref</a></li> 91 Default - use interface version 0.2 and NULL device ref</a></li>
96 </ul> 92 </ul>
97 </div> 93 </div>
98 <div id="control_panel" style="display:none"> 94 <div id="control_panel" style="display:none">
99 <a href="javascript:Stop();">Stop</a> 95 <a href="javascript:Stop();">Stop</a>
100 <a href="javascript:Start();">Start</a> 96 <a href="javascript:Start();">Start</a>
101 </div> 97 </div>
102 <div id="status"></div> 98 <div id="status"></div>
103 </body> 99 </body>
104 </html> 100 </html>
OLDNEW
« no previous file with comments | « ppapi/examples/audio_input/audio_input.cc ('k') | ppapi/native_client/src/untrusted/pnacl_irt_shim/pnacl_shim.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698