OLD | NEW |
1 /** | 1 /** |
2 * Copyright 2014 The Chromium Authors. All rights reserved. | 2 * Copyright 2014 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 /** | 7 /** |
8 * See http://dev.w3.org/2011/webrtc/editor/getusermedia.html for more | 8 * See http://dev.w3.org/2011/webrtc/editor/getusermedia.html for more |
9 * information on getUserMedia. See | 9 * information on getUserMedia. See |
10 * http://dev.w3.org/2011/webrtc/editor/webrtc.html for more information on | 10 * http://dev.w3.org/2011/webrtc/editor/webrtc.html for more information on |
(...skipping 560 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
571 | 571 |
572 /** | 572 /** |
573 * Creates a peer connection. Must be called before most other public functions | 573 * Creates a peer connection. Must be called before most other public functions |
574 * in this file. | 574 * in this file. |
575 */ | 575 */ |
576 function preparePeerConnection() { | 576 function preparePeerConnection() { |
577 if (global.peerConnection != null) | 577 if (global.peerConnection != null) |
578 error_('creating peer connection, but we already have one.'); | 578 error_('creating peer connection, but we already have one.'); |
579 | 579 |
580 global.peerConnection = createPeerConnection(STUN_SERVER); | 580 global.peerConnection = createPeerConnection(STUN_SERVER); |
581 print_('ok-peerconnection-created'); | 581 success_('ok-peerconnection-created'); |
582 } | 582 } |
583 | 583 |
584 /** | 584 /** |
585 * Adds the local stream to the peer connection. You will have to re-negotiate | 585 * Adds the local stream to the peer connection. You will have to re-negotiate |
586 * the call for this to take effect in the call. | 586 * the call for this to take effect in the call. |
587 */ | 587 */ |
588 function addLocalStream() { | 588 function addLocalStream() { |
589 if (global.peerConnection == null) | 589 if (global.peerConnection == null) |
590 error_('adding local stream, but we have no peer connection.'); | 590 error_('adding local stream, but we have no peer connection.'); |
591 | 591 |
(...skipping 798 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1390 | 1390 |
1391 /** @private */ | 1391 /** @private */ |
1392 function readResponseHeader_(request, key) { | 1392 function readResponseHeader_(request, key) { |
1393 var value = request.getResponseHeader(key); | 1393 var value = request.getResponseHeader(key); |
1394 if (value == null || value.length == 0) { | 1394 if (value == null || value.length == 0) { |
1395 error_('Received empty value ' + value + | 1395 error_('Received empty value ' + value + |
1396 ' for response header key ' + key + '.'); | 1396 ' for response header key ' + key + '.'); |
1397 } | 1397 } |
1398 return parseInt(value); | 1398 return parseInt(value); |
1399 } | 1399 } |
OLD | NEW |