[iOS] `getDisplayMedia()` not working
See original GitHub issueI have this RN app which was setup via Expo SDK 46 and, after realizing screen capture is provided by this package, I’ve decided to give it a try. I already had a working webrtc display app (using PeerJS), so I’ve created a simple RN client app with a button for obtaining a stream and connecting to the display and share it.
If I use getUserMedia({ video: true })
then I can see my camera feed being shared on the screen. However, if I use getDisplayMedia()
, I get a blank stream.
The call to getDisplayMedia()
doesn’t seem to fail and I get a stream though:
{"_reactTag": "A15DC054-32BA-4A9C-96BD-F02CF5D79923", "_tracks": [{"_constraints": [Object], "_enabled": true, "_muted": false, "_settings": [Object], "id": "3384
03C0-2147-409F-90D8-4347ED9CC0E0", "kind": "video", "label": "338403C0-2147-409F-90D8-4347ED9CC0E0", "readyState": "live", "remote": false}], "active": true, "id": "A15
DC054-32BA-4A9C-96BD-F02CF5D79923"}
I also couldn’t spot anything obvious on iOS syslog.
Expected Behavior
I would expect some sort of pop-up to ask for permissions to record screen, and then would expect to see my phone screen being shared on my display app.
Observed Behavior
Instead I get a blank stream, which reports 0 FPS on the display side.
Steps to reproduce the issue
- Create Expo app
- Install
react-native-webrtc
and@config-plugins/react-native-webrtc
- Configure config plugin in
app.json
- Build development app via EAS and install on iPhone
- Run sample code (via
expo start --dev-client
)
Platform Information
- React Native Version: 0.69.4
- Plugin Version: 1.100.1
- OS: iOS
- OS Version: 15.6
Issue Analytics
- State:
- Created a year ago
- Comments:13 (7 by maintainers)
Top GitHub Comments
Finally got it to work on iOS. I guess I was missing the whole
ScreenCapturePickerView
logic.Even though I got it working, a few notes:
ScreenCapturePickerView
is (in terms of what it exactly does and timings)Either way, thanks for the help!! I’ll close this issue for now, but would like to see this better documented so everyone can understand exactly what to do to get screen capture working.
I’d be happy to help in whatever I can…
I didn’t know that was possible with Expo plugins, nice!