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 /** @private */ | 7 /** @private */ |
8 var gTransformOutgoingSdp = function(sdp) { return sdp; } | 8 var gTransformOutgoingSdp = function(sdp) { return sdp; } |
9 | 9 |
10 /** @private */ | 10 /** @private */ |
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
210 function() { success_('setLocalDescription'); }, | 210 function() { success_('setLocalDescription'); }, |
211 function() { failure_('setLocalDescription'); }); | 211 function() { failure_('setLocalDescription'); }); |
212 debug("Sending SDP message:\n" + session_description.sdp); | 212 debug("Sending SDP message:\n" + session_description.sdp); |
213 sendToPeer(gRemotePeerId, JSON.stringify(session_description)); | 213 sendToPeer(gRemotePeerId, JSON.stringify(session_description)); |
214 } | 214 } |
215 | 215 |
216 /** @private */ | 216 /** @private */ |
217 function addStreamCallback_(event) { | 217 function addStreamCallback_(event) { |
218 debug('Receiving remote stream...'); | 218 debug('Receiving remote stream...'); |
219 var videoTag = document.getElementById('remote-view'); | 219 var videoTag = document.getElementById('remote-view'); |
220 videoTag.src = webkitURL.createObjectURL(event.stream); | 220 attachMediaStream(videoTag, event.stream); |
221 | 221 |
222 // Due to crbug.com/110938 the size is 0 when onloadedmetadata fires. | 222 // Due to crbug.com/110938 the size is 0 when onloadedmetadata fires. |
223 // videoTag.onloadedmetadata = updateVideoTagSize_('remote-view'); | 223 // videoTag.onloadedmetadata = updateVideoTagSize_('remote-view'); |
224 // Use setTimeout as a workaround for now. | 224 // Use setTimeout as a workaround for now. |
225 setTimeout(function() {updateVideoTagSize_('remote-view')}, 500); | 225 setTimeout(function() {updateVideoTagSize_('remote-view')}, 500); |
226 } | 226 } |
227 | 227 |
228 /** @private */ | 228 /** @private */ |
229 function removeStreamCallback_(event) { | 229 function removeStreamCallback_(event) { |
230 debug('Call ended.'); | 230 debug('Call ended.'); |
(...skipping 21 matching lines...) Expand all Loading... |
252 // about the created data channel. | 252 // about the created data channel. |
253 onDataChannelReadyStateChange_(); | 253 onDataChannelReadyStateChange_(); |
254 } | 254 } |
255 | 255 |
256 /** @private */ | 256 /** @private */ |
257 function onDataChannelReadyStateChange_() { | 257 function onDataChannelReadyStateChange_() { |
258 var readyState = gDataChannel.readyState; | 258 var readyState = gDataChannel.readyState; |
259 debug('DataChannel state:' + readyState); | 259 debug('DataChannel state:' + readyState); |
260 gDataStatusCallback(readyState); | 260 gDataStatusCallback(readyState); |
261 } | 261 } |
OLD | NEW |