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

Side by Side Diff: chrome/test/data/webrtc/manual/peerconnection.js

Issue 12472032: Add screen capture constraints, video tag resize and removed auto video resize (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@testingscreen
Patch Set: change border color to #aaa Created 7 years, 8 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
OLDNEW
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
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,
132 video: {mandatory: {chromeMediaSource: 'screen'}}
133 };
134 if ($('audio').checked == true)
135 debug('Audio for screencapture is not implemented as of M28, please ' +
136 'try to set audio = false prior requesting screencapture');
137 }
129 $('getusermedia-constraints').value = 138 $('getusermedia-constraints').value =
130 JSON.stringify(constraints, null, ' '); 139 JSON.stringify(constraints, null, ' ');
131 } 140 }
132 141
133 function showServerHelp() { 142 function showServerHelp() {
134 alert('You need to build and run a peerconnection_server on some ' + 143 alert('You need to build and run a peerconnection_server on some ' +
135 'suitable machine. To build it in chrome, just run make/ninja ' + 144 'suitable machine. To build it in chrome, just run make/ninja ' +
136 'peerconnection_server. Otherwise, read in https://code.google' + 145 'peerconnection_server. Otherwise, read in https://code.google' +
137 '.com/searchframe#xSWYf0NTG_Q/trunk/peerconnection/README&q=REA' + 146 '.com/searchframe#xSWYf0NTG_Q/trunk/peerconnection/README&q=REA' +
138 'DME%20package:webrtc%5C.googlecode%5C.com.'); 147 'DME%20package:webrtc%5C.googlecode%5C.com.');
(...skipping 20 matching lines...) Expand all
159 $('pc-createoffer-constraints').value = JSON.stringify( 168 $('pc-createoffer-constraints').value = JSON.stringify(
160 gCreateOfferConstraints, null, ' '); 169 gCreateOfferConstraints, null, ' ');
161 $('pc-createanswer-constraints').value = JSON.stringify( 170 $('pc-createanswer-constraints').value = JSON.stringify(
162 gCreateAnswerConstraints, null, ' '); 171 gCreateAnswerConstraints, null, ' ');
163 replaceReturnCallback(print_); 172 replaceReturnCallback(print_);
164 replaceDebugCallback(debug_); 173 replaceDebugCallback(debug_);
165 updateGetUserMediaConstraints(); 174 updateGetUserMediaConstraints();
166 doNotAutoAddLocalStreamWhenCalled(); 175 doNotAutoAddLocalStreamWhenCalled();
167 hookupDataChannelCallbacks_(); 176 hookupDataChannelCallbacks_();
168 hookupDtmfSenderCallback_(); 177 hookupDtmfSenderCallback_();
178 displayVideoSize_($('local-view'));
179 displayVideoSize_($('remote-view'));
169 }; 180 };
170 181
171 /** 182 /**
172 * Disconnect before the tab is closed. 183 * Disconnect before the tab is closed.
173 */ 184 */
174 window.onunload = function() { 185 window.onunload = function() {
175 if (!isDisconnected()) 186 if (!isDisconnected())
176 disconnect(); 187 disconnect();
177 }; 188 };
178 189
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
295 setOnToneChange(function(tone) { 306 setOnToneChange(function(tone) {
296 debug('Sent DTMF tone: ' + tone.tone); 307 debug('Sent DTMF tone: ' + tone.tone);
297 $('dtmf-tones-sent').value = 308 $('dtmf-tones-sent').value =
298 tone.tone + '\n' + $('dtmf-tones-sent').value; 309 tone.tone + '\n' + $('dtmf-tones-sent').value;
299 }); 310 });
300 } 311 }
301 312
302 $ = function(id) { 313 $ = function(id) {
303 return document.getElementById(id); 314 return document.getElementById(id);
304 }; 315 };
OLDNEW
« no previous file with comments | « chrome/test/data/webrtc/manual/peerconnection.html ('k') | chrome/test/data/webrtc/manual/stylesheet.css » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698