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 // Public interface towards the other javascript files, such as | 7 // Public interface towards the other javascript files, such as |
8 // message_handling.js. The contract for these functions is described in | 8 // message_handling.js. The contract for these functions is described in |
9 // message_handling.js. | 9 // message_handling.js. |
10 | 10 |
(...skipping 15 matching lines...) Expand all Loading... |
26 } else if (parsed_msg.candidate) { | 26 } else if (parsed_msg.candidate) { |
27 var candidate = new RTCIceCandidate(parsed_msg); | 27 var candidate = new RTCIceCandidate(parsed_msg); |
28 peerConnection.addIceCandidate(candidate); | 28 peerConnection.addIceCandidate(candidate); |
29 return; | 29 return; |
30 } | 30 } |
31 addTestFailure("unknown message received"); | 31 addTestFailure("unknown message received"); |
32 return; | 32 return; |
33 } | 33 } |
34 | 34 |
35 function createPeerConnection(stun_server) { | 35 function createPeerConnection(stun_server) { |
36 servers = {iceServers:[{uri:"stun:" + stun_server}]}; | 36 servers = {iceServers:[{url:"stun:" + stun_server}]}; |
37 try { | 37 try { |
38 peerConnection = new webkitRTCPeerConnection(servers, null); | 38 peerConnection = new webkitRTCPeerConnection(servers, null); |
39 } catch (exception) { | 39 } catch (exception) { |
40 failTest('Failed to create peer connection: ' + exception); | 40 failTest('Failed to create peer connection: ' + exception); |
41 } | 41 } |
42 peerConnection.onaddstream = addStreamCallback_; | 42 peerConnection.onaddstream = addStreamCallback_; |
43 peerConnection.onremovestream = removeStreamCallback_; | 43 peerConnection.onremovestream = removeStreamCallback_; |
44 peerConnection.onicecandidate = iceCallback_; | 44 peerConnection.onicecandidate = iceCallback_; |
45 return peerConnection; | 45 return peerConnection; |
46 } | 46 } |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
92 // This only mean that we have received a valid SDP message with an offer or | 92 // This only mean that we have received a valid SDP message with an offer or |
93 // an answer, it does not mean that audio and video works. | 93 // an answer, it does not mean that audio and video works. |
94 returnToTest('ok-got-remote-stream'); | 94 returnToTest('ok-got-remote-stream'); |
95 } | 95 } |
96 | 96 |
97 /** @private */ | 97 /** @private */ |
98 function removeStreamCallback_(event) { | 98 function removeStreamCallback_(event) { |
99 debug('Call ended.'); | 99 debug('Call ended.'); |
100 document.getElementById("remote-view").src = ''; | 100 document.getElementById("remote-view").src = ''; |
101 } | 101 } |
OLD | NEW |