Skip to content
Snippets Groups Projects
Commit b50cd63d authored by Neil Gershenfeld's avatar Neil Gershenfeld
Browse files

new video call

parent ec6e1a70
No related branches found
No related tags found
No related merge requests found
......@@ -146,25 +146,19 @@ function start_video() {
var ctx = mod.img.getContext("2d")
ctx.canvas.width = w
ctx.canvas.height = h
navigator.getMedia = (
navigator.getUserMedia ||
navigator.webkitGetUserMedia ||
navigator.mozGetUserMedia ||
navigator.msGetUserMedia)
navigator.getMedia(
{video:true,audio:false},
function(stream) {
var vendorURL = window.URL || window.webkitURL
mod.video.src = vendorURL.createObjectURL(stream)
var constraints = {
audio:false,
video:{width:w,height:h}
}
navigator.mediaDevices.getUserMedia(constraints)
.then(function(stream) {
mod.video.srcObject = stream
mod.video.onloadedmetadata = function(e) {
mod.video.play()
},
function(err) {console.log("video startup error")}
)
mod.video.addEventListener('canplay',
function(evt) {
mod.video.setAttribute('width',w)
mod.video.setAttribute('height',h)
capture_video()
}
})
.catch(function(err) {
console.log(err.name + ": "+err.message)
})
}
function update_video() {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment