filestack / filestack-js

Official Javascript SDK for the Filestack API and content ingestion system.
https://www.filestack.com
MIT License
206 stars 77 forks source link

Filepicker webcam option freezes camera on iOS mobile Safari #396

Open Greeeeyyyss opened 3 years ago

Greeeeyyyss commented 3 years ago

We are experiencing an issue when opening the webcam option of the file picker, the video/camera feed appears to be lagging when opened in Safari on iOS devices. It seems to be getting the first frame only and this is not happening on Google Chrome on Android and on PC web, and on Safari PC. The issue would be similar to this.

I'm not sure if the webcam option is using an html video element + getUserMedia() API but the possible fix would be to add these 3 properties:

<video ref={videoRef} autoPlay playsInline muted />

or play the video after the metadata is loaded:

videoRef.current.onloadedmetadata = () => {
     videoRef.current?.play();
};

Devices: iPhone 6, 6+ and iPhone SE. Attachment: FileStack picker issue video