Skip to content

Instantly share code, notes, and snippets.

@coreyauger
Created September 29, 2014 05:40
Show Gist options
  • Save coreyauger/066e1476999005571bb7 to your computer and use it in GitHub Desktop.
Save coreyauger/066e1476999005571bb7 to your computer and use it in GitHub Desktop.
Example passing in dataChannel
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