livekit / client-sdk-swift

LiveKit Swift Client SDK. Easily build live audio or video experiences on iOS, macOS, tvOS, and visionOS.
https://livekit.io
Apache License 2.0
197 stars 97 forks source link

Screen share track stops working when the app isn't foreground, and resumes working if you return to the app. #328

Closed GiauHuynhWiki closed 8 months ago

GiauHuynhWiki commented 8 months ago
Screenshot 2024-01-30 at 13 38 54

The screen share track works perfectly in-app. But I want to share the iphone home screen, so I switch to home screen, at this time, the screen share track pauses. Then I back to app again, the screen share track resumes working.

Seem root-cause is at Broadcast Upload Extension, I set up the extension from https://github.com/livekit/client-sdk-swift/wiki/iOS-Screen-Sharing Is there any way to make sure I have it set up Broadcast Upload Extension correctly? Seem it's can't debug, print... directly.

BroadcastExtension

Screenshot 2024-01-30 at 13 54 15

Info (I copy from example code then change RTCAppGroupIdentifier)

Screenshot 2024-01-30 at 13 54 25

SampleHandler

Screenshot 2024-01-30 at 13 54 34

LoggingOSLog

Screenshot 2024-01-30 at 13 55 11
GiauHuynhWiki commented 8 months ago

I found where is the error, I missed add RoomOptions when call room.connect

Screenshot 2024-01-30 at 14 36 53

After set RoomOptions as the above image, everything works OK as my expected. Thanks monkeyttttt to support me.