简体   繁体   中英

GetUserMedia iOS issue?

I'm using the following code in an HTML5 page. When I run my page on Android and PC (chrome), the code works fine and I get the correct JavaScript alert(); but when I run the same page on an iOS device like iPhone or iPad, I don't get anything (no alert() at all).

This is my code:

navigator.getUserMedia = ( navigator.getUserMedia || // use the proper vendor prefix
                       navigator.webkitGetUserMedia ||
                       navigator.mozGetUserMedia ||
                       navigator.msGetUserMedia);

navigator.getUserMedia({video: true}, function() {
   alert('camera is supported in your browser');
}, function() {
   alert('camera is not supported in your browser!');
});

Is there something that I'm missing?

Any help would be appreciated.

一旦iOS11发布,它将在 2017 年秋季生效

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM