OLD | NEW |
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>Video Capture Example</title> | 9 <title>Video Capture Example</title> |
10 <script type="text/javascript"> | 10 <script type="text/javascript"> |
(...skipping 20 matching lines...) Expand all Loading... |
31 list.appendChild(list_item); | 31 list.appendChild(list_item); |
32 } | 32 } |
33 } | 33 } |
34 } | 34 } |
35 } | 35 } |
36 | 36 |
37 function UseDesignatedDevice(index) { | 37 function UseDesignatedDevice(index) { |
38 UseDevice(device_array[index], index); | 38 UseDevice(device_array[index], index); |
39 } | 39 } |
40 | 40 |
41 function UseDefaultDevice(use_0_1_interface) { | 41 function UseDefaultDevice() { |
42 var display_text = use_0_1_interface ? 'Default(v0.1)' : 'Default'; | 42 UseDevice('Default', 'UseDefault'); |
43 var command = use_0_1_interface ? 'UseDefault(v0.1)' : 'UseDefault'; | |
44 UseDevice(display_text, command); | |
45 } | 43 } |
46 | 44 |
47 function UseDevice(display_text, command) { | 45 function UseDevice(display_text, command) { |
48 var in_use_device = document.getElementById('in_use_device'); | 46 var in_use_device = document.getElementById('in_use_device'); |
49 in_use_device.innerText = display_text; | 47 in_use_device.innerText = display_text; |
50 var plugin = document.getElementById('plugin'); | 48 var plugin = document.getElementById('plugin'); |
51 plugin.postMessage(command); | 49 plugin.postMessage(command); |
52 | 50 |
53 var available_devices = document.getElementById('available_devices'); | 51 var available_devices = document.getElementById('available_devices'); |
54 available_devices.parentNode.removeChild(available_devices); | 52 available_devices.parentNode.removeChild(available_devices); |
(...skipping 22 matching lines...) Expand all Loading... |
77 | 75 |
78 <body> | 76 <body> |
79 <embed id="plugin" type="application/x-ppapi-example-video-capture" | 77 <embed id="plugin" type="application/x-ppapi-example-video-capture" |
80 width="320" height="240"/> | 78 width="320" height="240"/> |
81 <div style="margin-bottom:10px">In-use device: | 79 <div style="margin-bottom:10px">In-use device: |
82 <span id="in_use_device" style="font-weight:bold">None</span> | 80 <span id="in_use_device" style="font-weight:bold">None</span> |
83 </div> | 81 </div> |
84 <div id="available_devices"> | 82 <div id="available_devices"> |
85 Available device(s), choose one to open: | 83 Available device(s), choose one to open: |
86 <ul id="device_list"> | 84 <ul id="device_list"> |
87 <li><a href="javascript:UseDefaultDevice(true);"> | 85 <li><a href="javascript:UseDefaultDevice();">Default</a></li> |
88 Default - use interface version 0.1</a></li> | |
89 <li><a href="javascript:UseDefaultDevice(false);">Default</a></li> | |
90 </ul> | 86 </ul> |
91 </div> | 87 </div> |
92 <div id="control_panel"></div> | 88 <div id="control_panel"></div> |
93 <div id="status"></div> | 89 <div id="status"></div> |
94 </body> | 90 </body> |
95 </html> | 91 </html> |
OLD | NEW |