if(navigator.webkitGetUserMedia) { // WebKit-prefixed
alert(1);
navigator.webkitGetUserMedia(videoObj, function(stream){
track = stream.getTracks()[0];
video_camera_capture.src = window.webkitURL.createObjectURL(stream);
video_camera_capture.play();
}, errBack);
}
else if(navigator.getUserMedia) { // Standard
alert(2);
navigator.getUserMedia(videoObj, function(stream) {
track = stream.getTracks()[0];
video_camera_capture.src = stream;
video_camera_capture.play();
}, errBack);
}else if(navigator.mozGetUserMedia) { // Firefox-prefixed
alert(3);
navigator.mozGetUserMedia(videoObj, function(stream){
track = stream.getTracks()[0];
video_camera_capture.src = window.URL.createObjectURL(stream);
video_camera_capture.play();
}, errBack);
}
我想要一个使用jquery在safari中访问网络摄像头的解决方案。以上代码用于chrome,mozilla和普通浏览器。所以,如果有人知道解决方案,请帮助。
答案 0 :(得分:0)
在Windows Safari中不支持Html 5视频。在MAC OSit中将正常工作