-
-
Save coreyauger/066e1476999005571bb7 to your computer and use it in GitHub Desktop.
Example passing in dataChannel
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
worker.webrtc().onAddRemoteStream = (uuid, video, dataChannel) -> | |
id = $scope.peers.length+1; | |
dataChannelList.push(dataChannel) | |
$scope.peers.push({ | |
uuid:uuid | |
local: false | |
username: '' | |
id: id | |
}) | |
jidToPeerId[uuid] = id | |
dataChannel.onmessage = (msg) => | |
console.log('onmessage',msg) | |
$scope.msgs.push(msg.data) | |
setTimeout(-> | |
$scope.$apply() | |
,0) | |
setTimeout(-> | |
$scope.$apply() | |
$('#video'+id).append(video) | |
,0) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment