Created
January 11, 2015 04:58
-
-
Save thesabbir/64e8a984ec71bd90dd39 to your computer and use it in GitHub Desktop.
WebRTC example by LLC // source http://jsbin.com/galoxu
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> | |
<meta name="description" content="WebRTC example by LLC" /> | |
<meta charset="utf-8"> | |
<title>JS Bin</title> | |
</head> | |
<body> | |
<h3>You Will Appear Here If you allow this page to use your camera.</h3> | |
<video> | |
</video> | |
<script id="jsbin-javascript"> | |
// Settings | |
var settings = { | |
video: true, | |
audio: false | |
}; | |
//Success callback | |
var success = function (localMediaStream) { | |
var video = document.querySelector('video'); | |
video.src = window.URL.createObjectURL(localMediaStream); | |
video.play(); | |
}; | |
//Error callback | |
var error = function (err) { | |
console.log("[Error] : " + err); | |
}; | |
//Determining getUserMedia by Browser Vendor | |
navigator.getUserMedia = ( navigator.getUserMedia || navigator.webkitGetUserMedia || navigator.moz); | |
//Calling Navigator | |
navigator.getUserMedia(settings, success, error); | |
</script> | |
<script id="jsbin-source-javascript" type="text/javascript">// Settings | |
var settings = { | |
video: true, | |
audio: false | |
}; | |
//Success callback | |
var success = function (localMediaStream) { | |
var video = document.querySelector('video'); | |
video.src = window.URL.createObjectURL(localMediaStream); | |
video.play(); | |
}; | |
//Error callback | |
var error = function (err) { | |
console.log("[Error] : " + err); | |
}; | |
//Determining getUserMedia by Browser Vendor | |
navigator.getUserMedia = ( navigator.getUserMedia || navigator.webkitGetUserMedia || navigator.moz); | |
//Calling Navigator | |
navigator.getUserMedia(settings, success, error);</script></body> | |
</html> |
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
// Settings | |
var settings = { | |
video: true, | |
audio: false | |
}; | |
//Success callback | |
var success = function (localMediaStream) { | |
var video = document.querySelector('video'); | |
video.src = window.URL.createObjectURL(localMediaStream); | |
video.play(); | |
}; | |
//Error callback | |
var error = function (err) { | |
console.log("[Error] : " + err); | |
}; | |
//Determining getUserMedia by Browser Vendor | |
navigator.getUserMedia = ( navigator.getUserMedia || navigator.webkitGetUserMedia || navigator.moz); | |
//Calling Navigator | |
navigator.getUserMedia(settings, success, error); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment