Home > front end >  On the web for ios camera problems, seek guidance
On the web for ios camera problems, seek guidance

Time:10-09


As shown in figure, allows you to use the camera after page did not show, don't know why

CodePudding user response:



<meta charset="utf-8" & gt;
Document

<body>



Window. The addEventListener (" DOMContentLoaded ", function () {
Var canvas=document. GetElementById (" canvas "),
The context=canvas. GetContext (" 2 d "),
Video=document. GetElementById (" video "),
VideoObj={" video ": true},
ErrBack=function (error) {
The console. The log (" Video capture the error: ", the error. The code).
};
If (the navigator. GetUserMedia) {
The navigator. GetUserMedia (videoObj, function (stream) {
Video. SRC=https://bbs.csdn.net/topics/stream;
Video. The play ();
}, errBack);
{} else if (the navigator webkitGetUserMedia)
The navigator. WebkitGetUserMedia (videoObj, function (stream) {
Video. SRC=https://bbs.csdn.net/topics/window.webkitURL.createObjectURL (stream);
Video. The play ();
}, errBack);
}
Else if (the navigator. MozGetUserMedia) {
The navigator. MozGetUserMedia (videoObj, function (stream) {
Video. SRC=https://bbs.csdn.net/topics/window.URL.createObjectURL (stream);
Video. The play ();
}, errBack);
}
}, false);
</script>

CodePudding user response:

The navigator. GetUserMedia (videoObj, function (stream) {
video. SRC=https://bbs.csdn.net/topics/stream;
Video. The play ();
}, errBack);

Video. SRC=https://bbs.csdn.net/topics/window.webkitURL.createObjectURL (stream);

Web development learning materials recommended
Javascript client-side image preview
The json cross-domain access online agent

CodePudding user response:

Quote: refer to the second floor showbo response:

The navigator. GetUserMedia (videoObj, function (stream) {
video. SRC=https://bbs.csdn.net/topics/stream;
Video. The play ();
}, errBack);

Video. SRC=https://bbs.csdn.net/topics/window.webkitURL.createObjectURL (stream);

Still won't do...

CodePudding user response:

This method is not working on ios mobile ah baidu uc WeChat can invoke the navigator. MediaDevices methods lead to call is not successful

CodePudding user response:

IOS does not support the navigator mediaDevices, support safari11.2 above only,
  • Related