Created
June 21, 2015 22:21
-
-
Save nonchip/3be602caefc9f846097a to your computer and use it in GitHub Desktop.
rtcweb
This file contains hidden or 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
<script src="https://cdn.webrtc-experiment.com/RTCMultiConnection-v2.2.4.js"></script> | |
<script type="text/javascript"> | |
var con=new RTCMultiConnection("nonchip-rtcweb"); | |
con.userType = 'guest'; | |
con.session={ | |
audio: false, | |
video: false, | |
oneway: true, | |
data: true, | |
broadcast: true, | |
}; | |
con.onmessage=function(e){ | |
document.body.innerHTML=e.data; | |
}; | |
var hash=window.location.hash; | |
con.join(hash); | |
window.setInterval(function(){ | |
if(hash!=window.location.hash) | |
window.location.reload(); | |
},500); | |
</script> |
This file contains hidden or 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
<script src="https://cdn.webrtc-experiment.com/RTCMultiConnection-v2.2.4.js"></script> | |
<textarea id="theArea" style="width: 90%; height: 90%">empty...</textarea> | |
<script type="text/javascript"> | |
var con=new RTCMultiConnection("nonchip-rtcweb"); | |
con.userType = 'admin'; | |
con.session={ | |
audio: false, | |
video: false, | |
oneway: true, | |
data: true, | |
broadcast: true, | |
}; | |
var a=document.getElementById("theArea"); | |
con.onconnected=function(){ | |
con.send(a.value); | |
}; | |
window.setInterval(con.onconnected,1000); | |
con.open(window.location.hash); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment