Doorgaan
我们可以在navigator.getUserMedia (
// constraints
{
video: true,
audio: true
},
// successCallback
function(localMediaStream) {
var video = document.querySelector('video');
video.src = window.URL.createObjectURL(localMediaStream);
video.onloadedmetadata = function(e) {
// Do something with the video here.
};
},
// errorCallback
function(err) {
if(err === PERMISSION_DENIED) {
// Explain why you need permission and how to update the permission setting
}
}
);
但是后续更改用户如何允许或禁止在getUserMedia();
中录制视频或声音?
即。当记录已经进行并且用户想要阻止记录时(当他再次点击http://i.imgur.com/4IpJoGi.png时)。