OLD | NEW |
---|---|
1 /** | 1 /** |
2 * Copyright (c) 2012 The Chromium Authors. All rights reserved. | 2 * Copyright (c) 2012 The Chromium Authors. All rights reserved. |
3 * Use of this source code is governed by a BSD-style license that can be | 3 * Use of this source code is governed by a BSD-style license that can be |
4 * found in the LICENSE file. | 4 * found in the LICENSE file. |
5 */ | 5 */ |
6 | 6 |
7 // The *Here functions are called from peerconnection.html and will make calls | 7 // The *Here functions are called from peerconnection.html and will make calls |
8 // into our underlying JavaScript library with the values from the page | 8 // into our underlying JavaScript library with the values from the page |
9 // (have to be named differently to avoid name clashes with existing functions). | 9 // (have to be named differently to avoid name clashes with existing functions). |
10 | 10 |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
116 } | 116 } |
117 } | 117 } |
118 | 118 |
119 /** | 119 /** |
120 * Updates the constraints in the getusermedia-constraints text box with a | 120 * Updates the constraints in the getusermedia-constraints text box with a |
121 * MediaStreamConstraints string. This string is created based on the status of | 121 * MediaStreamConstraints string. This string is created based on the status of |
122 * the checkboxes for audio and video. | 122 * the checkboxes for audio and video. |
123 */ | 123 */ |
124 function updateGetUserMediaConstraints() { | 124 function updateGetUserMediaConstraints() { |
125 var constraints = { | 125 var constraints = { |
126 audio: $('audio').checked, | 126 audio: $('audio').checked, |
127 video: $('video').checked | 127 video: $('video').checked |
128 }; | 128 }; |
129 if ($('screencapture').checked) | |
130 var constraints = { | |
131 audio: $('audio').checked = false, | |
kjellander_chromium
2013/04/08 14:19:52
I don't think we should alter the $('audio').check
jansson
2013/04/10 12:11:48
Done.
| |
132 video: {mandatory: {chromeMediaSource: 'screen'}} | |
133 }; | |
129 $('getusermedia-constraints').value = | 134 $('getusermedia-constraints').value = |
130 JSON.stringify(constraints, null, ' '); | 135 JSON.stringify(constraints, null, ' '); |
131 } | 136 } |
132 | 137 |
133 function showServerHelp() { | 138 function showServerHelp() { |
134 alert('You need to build and run a peerconnection_server on some ' + | 139 alert('You need to build and run a peerconnection_server on some ' + |
135 'suitable machine. To build it in chrome, just run make/ninja ' + | 140 'suitable machine. To build it in chrome, just run make/ninja ' + |
136 'peerconnection_server. Otherwise, read in https://code.google' + | 141 'peerconnection_server. Otherwise, read in https://code.google' + |
137 '.com/searchframe#xSWYf0NTG_Q/trunk/peerconnection/README&q=REA' + | 142 '.com/searchframe#xSWYf0NTG_Q/trunk/peerconnection/README&q=REA' + |
138 'DME%20package:webrtc%5C.googlecode%5C.com.'); | 143 'DME%20package:webrtc%5C.googlecode%5C.com.'); |
(...skipping 20 matching lines...) Expand all Loading... | |
159 $('pc-createoffer-constraints').value = JSON.stringify( | 164 $('pc-createoffer-constraints').value = JSON.stringify( |
160 gCreateOfferConstraints, null, ' '); | 165 gCreateOfferConstraints, null, ' '); |
161 $('pc-createanswer-constraints').value = JSON.stringify( | 166 $('pc-createanswer-constraints').value = JSON.stringify( |
162 gCreateAnswerConstraints, null, ' '); | 167 gCreateAnswerConstraints, null, ' '); |
163 replaceReturnCallback(print_); | 168 replaceReturnCallback(print_); |
164 replaceDebugCallback(debug_); | 169 replaceDebugCallback(debug_); |
165 updateGetUserMediaConstraints(); | 170 updateGetUserMediaConstraints(); |
166 doNotAutoAddLocalStreamWhenCalled(); | 171 doNotAutoAddLocalStreamWhenCalled(); |
167 hookupDataChannelCallbacks_(); | 172 hookupDataChannelCallbacks_(); |
168 hookupDtmfSenderCallback_(); | 173 hookupDtmfSenderCallback_(); |
174 _displayVideoSize($('local-view')); | |
175 _displayVideoSize($('remote-view')); | |
169 }; | 176 }; |
170 | 177 |
171 /** | 178 /** |
172 * Disconnect before the tab is closed. | 179 * Disconnect before the tab is closed. |
173 */ | 180 */ |
174 window.onunload = function() { | 181 window.onunload = function() { |
175 if (!isDisconnected()) | 182 if (!isDisconnected()) |
176 disconnect(); | 183 disconnect(); |
177 }; | 184 }; |
178 | 185 |
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
295 setOnToneChange(function(tone) { | 302 setOnToneChange(function(tone) { |
296 debug('Sent DTMF tone: ' + tone.tone); | 303 debug('Sent DTMF tone: ' + tone.tone); |
297 $('dtmf-tones-sent').value = | 304 $('dtmf-tones-sent').value = |
298 tone.tone + '\n' + $('dtmf-tones-sent').value; | 305 tone.tone + '\n' + $('dtmf-tones-sent').value; |
299 }); | 306 }); |
300 } | 307 } |
301 | 308 |
302 $ = function(id) { | 309 $ = function(id) { |
303 return document.getElementById(id); | 310 return document.getElementById(id); |
304 }; | 311 }; |
OLD | NEW |