| 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 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 217 function() { success_('setLocalDescription'); }, | 217 function() { success_('setLocalDescription'); }, |
| 218 function() { failure_('setLocalDescription'); }); | 218 function() { failure_('setLocalDescription'); }); |
| 219 debug('Sending SDP message:\n' + session_description.sdp); | 219 debug('Sending SDP message:\n' + session_description.sdp); |
| 220 sendToPeer(gRemotePeerId, JSON.stringify(session_description)); | 220 sendToPeer(gRemotePeerId, JSON.stringify(session_description)); |
| 221 } | 221 } |
| 222 | 222 |
| 223 /** @private */ | 223 /** @private */ |
| 224 function addStreamCallback_(event) { | 224 function addStreamCallback_(event) { |
| 225 debug('Receiving remote stream...'); | 225 debug('Receiving remote stream...'); |
| 226 var videoTag = document.getElementById('remote-view'); | 226 var videoTag = document.getElementById('remote-view'); |
| 227 videoTag.src = webkitURL.createObjectURL(event.stream); | 227 attachMediaStream(videoTag, event.stream); |
| 228 | 228 |
| 229 // Due to crbug.com/110938 the size is 0 when onloadedmetadata fires. | 229 // Due to crbug.com/110938 the size is 0 when onloadedmetadata fires. |
| 230 // videoTag.onloadedmetadata = displayVideoSize_(videoTag); | 230 // videoTag.onloadedmetadata = displayVideoSize_(videoTag); |
| 231 // Use setTimeout as a workaround for now. | 231 // Use setTimeout as a workaround for now. |
| 232 // Displays the remote video size for both the video element and the stream. | 232 // Displays the remote video size for both the video element and the stream. |
| 233 setTimeout(function() {displayVideoSize_(videoTag);}, 500); | 233 setTimeout(function() {displayVideoSize_(videoTag);}, 500); |
| 234 } | 234 } |
| 235 | 235 |
| 236 /** @private */ | 236 /** @private */ |
| 237 function removeStreamCallback_(event) { | 237 function removeStreamCallback_(event) { |
| (...skipping 22 matching lines...) Expand all Loading... |
| 260 // about the created data channel. | 260 // about the created data channel. |
| 261 onDataChannelReadyStateChange_(); | 261 onDataChannelReadyStateChange_(); |
| 262 } | 262 } |
| 263 | 263 |
| 264 /** @private */ | 264 /** @private */ |
| 265 function onDataChannelReadyStateChange_() { | 265 function onDataChannelReadyStateChange_() { |
| 266 var readyState = gDataChannel.readyState; | 266 var readyState = gDataChannel.readyState; |
| 267 debug('DataChannel state:' + readyState); | 267 debug('DataChannel state:' + readyState); |
| 268 gDataStatusCallback(readyState); | 268 gDataStatusCallback(readyState); |
| 269 } | 269 } |
| OLD | NEW |