Created
April 2, 2014 12:43
-
-
Save aBuder/9933328 to your computer and use it in GitHub Desktop.
SimplewebRTC has no method 'sendDirectlyToAll'
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
$(document).ready( | |
function (){ | |
var webrtc = new SimpleWebRTC({ | |
// the id/element dom element that will hold "our" video | |
localVideoEl: 'localVideo', | |
// the id/element dom element that will hold remote videos | |
remoteVideosEl: 'remoteVideos', | |
// immediately ask for camera access | |
autoRequestMedia: true, | |
debug: true, | |
media: { | |
video: false, | |
audio: true | |
} | |
}); | |
// we have to wait until it's ready | |
webrtc.on('readyToCall', function () { | |
// set the room | |
webrtc.joinRoom('testRoom'); | |
webrtc.sendDirectlyToAll('testRoom','setDisplayName', 'Alexander Buder'); | |
webrtc.on('channelMessage', function (peer, label, data) { | |
if (data.type == 'setDisplayName') { | |
var name = data.payload; | |
console.log('Received displayName ' + name + ' from peer ' + peer.id); | |
} | |
}); | |
}); | |
}); | |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<script src="http://code.jquery.com/jquery-1.9.1.min.js"></script> | |
<meta charset="utf-8"> | |
<title>SimplewebRTC Test App</title> | |
<!-- Please set your link to app --> | |
<script src="https://raw.githubusercontent.com/HenrikJoreteg/SimpleWebRTC/master/simplewebrtc.bundle.js"></script> | |
</head> | |
<body> | |
<video id="localVideo"></video> | |
<div id="remoteVideos"></div> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment