macOS Safari problem with (getUserMedia) getting video stream from camera in angular 6 - NotReadable

937 views
Skip to first unread message

s.koli...@graphicbox.pl

unread,
Sep 16, 2018, 1:51:05 AM9/16/18
to discuss-webrtc

Problem is appeared when I try get video stream from camera in mac on safari (in angular).
For get stream I use function navigator.mediaDevices.getUserMedia({video: true})
On chrome it works nice, but in safari it sometimes throw error:

NotReadableError: The I/O read operation failed.


From documentation:
NotReadableError
Although the user granted permission to use the matching devices, a hardware error occurred at the operating system, browser, or Web page level which prevented access to the device.


getUserMedia_error.png











The most strange that it's not stable, it error can appear and after sometime it will be work fine (without changing a code)...I checked it a lot of times on 3 different macs and didn't find dependency why it or work or no, but error appeared on every mac.


Another one strange thing that error shows only in angular, so I thought that problem could be with zone.jsbut I didn't find solution when trying take out call of function for getting stream from zone (for take out from zone I used runOutsideAngular and run).


I tried to use some npm libraries like ngx-webcamack-angular-webcam but that didn't help too, when error shows in my code it appears in plugins code too (I guess it cause they use same func to get stream).


So, my long research in internet didn't give appropriate result and I have to ask about advice, solution or at least idea.


My question
How to avoid appearing of this error, why it shows not constantly and what is the reason for this error?

Thanks for your help.

Reply all
Reply to author
Forward
0 new messages