livekit / client-sdk-swift

LiveKit Swift Client SDK. Easily build live audio or video experiences into your mobile app, game or website.
https://livekit.io
Apache License 2.0
173 stars 84 forks source link

About iOS Screen Share didn't work. #395

Open 107360111 opened 1 month ago

107360111 commented 1 month ago

Hello everyone, here is a question about broadcast.

According to the description of iOS Screen Sharing on Wiki, I have followed the instructions to set up the broadcast. Here are the App Groups and SampleHandler after setup:

App Groups:

Sample Handler:

Additionally, I have enabled the broadcast permission in the Room settings. I am using the following code to receive the localParticipant and remoteParticipant:

Room Initialization:

Control Screen Share Function:

Get Local Participant: [room(_ room: Room, participant: LocalParticipant, didPublishTrack publication: LocalTrackPublication)]

Get Remote Participant: [room(_ room: Room, participant: RemoteParticipant, didSubscribeTrack publication: RemoteTrackPublication)]

When I first press the screen sharing button, a prompt window like the one in the picture appears. After I press "Start Recording", the screen recording starts. However, in the function room( room: Room, participant: LocalParticipant, didPublishTrack publication: LocalTrackPublication), I did not receive the video track that I sent out. Also, in the function room( room: Room, participant: RemoteParticipant, didSubscribeTrack publication: RemoteTrackPublication), I did not receive the event of subscribing to my own video track.

Local Participant Start Recording:

Remote Participant Didn't Get Local Participant's screen share video track:

Local Participant Stop Recording:

Please help me to solve this question, thank you very much.