Tastenkunst / brfv4_javascript_examples

BRFv4 - HTML5/Javascript - examples project. Reference implementation for all other platform example packages.
463 stars 148 forks source link

can not run on ios safari #5

Closed cnjack closed 7 years ago

cnjack commented 7 years ago

Unhandled Promise Rejection: NotAllowedError (DOM Exception 35): The request is not allowed by the user agent or the platform in the current context, possibly because the user denied permission.

webcam.onStreamFetched = function(mediaStream) {

    webcam.stream = mediaStream;

    if(webcam.video !== null) {
        webcam.video.srcObject = mediaStream;
        webcam.video.play();
        webcam.onStreamDimensionsAvailable();
    }
};
MarcelKlammer commented 7 years ago

iOS 10 or iOS 11 beta?

cnjack commented 7 years ago

IOS11 beta

cnjack commented 7 years ago

Iphone SE

MarcelKlammer commented 7 years ago

Tested it last week on my iPad Pro iOS 11 beta and it started. Hope to find some time next week to take a look again.

cnjack commented 7 years ago

I will try fix it if I have time~~

cnjack commented 7 years ago

NotAllowedError The user agent (browser) or operating system doesn't allow playback of media in the current context or situation. This may happen, for example, if the browser requires the user to explicitly start media playback by clicking a "play" button.

from https://developer.mozilla.org/en-US/docs/Web/API/HTMLMediaElement/play

cnjack commented 7 years ago

I try on my iPad mini 4, it worked!