Bug 260345 - navigator.mediaDevices.getUserMedia() requires playsinline on (hidden) video element to work on iOS
Summary: navigator.mediaDevices.getUserMedia() requires playsinline on (hidden) video ...
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: Media (show other bugs)
Version: Other
Hardware: iPhone / iPad Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: BrowserCompat, InRadar
Depends on:
Blocks:
 
Reported: 2023-08-17 06:30 PDT by Nico Weber
Modified: 2023-08-24 06:31 PDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Nico Weber 2023-08-17 06:30:07 PDT
Repro: https://github.com/nico/hack/blob/1e234e3a12a82d/webgl/cam.html , but the simpler https://jsfiddle.net/kw8fbcma/4/ probably also works if you delete the `video.playsInline = true;` on line 7.

WebKit/iOS is the only engine that requires `playsinline` for this to work. Without it, Safari/iOS only shows the first frame. With it, it shows a continuous webcam feed (with some color effect on top).

Things work fine in Safari/Mac (version 16.5, default on macOS 13.4), in Firefox/Mac, and in Chrome/Mac and Chrome/Android: There, you get a continuous webcam feed even without `playsinline`.

Given that the video element isn't even visible, maybe `playsinline` could be made not required for navigator.mediaDevices.getUserMedia(), for better web compat? Maybe even if navigator.mediaDevices.getUserMedia() goes to a visible video element?

(Note that I'm filing this as a private person, even though I use my old @chromium.org webkit.org account.)
Comment 1 Radar WebKit Bug Importer 2023-08-24 06:31:14 PDT
<rdar://problem/114379311>