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
176 stars 85 forks source link

share screen,app became purpse #279

Closed monkeyttttt closed 5 months ago

monkeyttttt commented 7 months ago

Describe the bug share screen,app became purpse

SDK Version SDK1.1.0

iOS/macOS Version xcode 15.0.1 IOS 17.1.1

Steps to Reproduce join room , then share screen

Expected behavior A clear and concise description of what you expected to happen. show UI normal Screenshots If applicable, add screenshots to help explain your problem.

https://github.com/livekit/client-sdk-swift/assets/4243863/b975d28e-5bb2-4396-99b5-2755aa3f65c7

Logs Please provide logs if you can.

monkeyttttt commented 7 months ago

private lazy var room: Room = { Room(delegate: self, connectOptions: ConnectOptions(), roomOptions: RoomOptions(defaultCameraCaptureOptions: CameraCaptureOptions())) }()

override func viewDidLoad() { super.viewDidLoad() room.connect(wsURL, token).then { room in // Publish camera & mic room.localParticipant?.setCamera(enabled: true) //room.localParticipant?.setMicrophone(enabled: true) }.catch { error in // failed to connect } }

func room(_ room: Room, localParticipant: LocalParticipant, didPublish publication: LocalTrackPublication) { print("====WDShareRoomViewController localParticipant didPublish... (room) (room.metadata)") guard let track = publication.track as? VideoTrack else { return } DispatchQueue.main.async { self.localVideoView.track = track localParticipant.setScreenShare(enabled: true) } }

GiauHuynhWiki commented 5 months ago

Hi @monkeyttttt , can I get in touch with you? I have some question about screen sharing feature.

monkeyttttt commented 5 months ago

Hi @monkeyttttt , can I get in touch with you? I have some question about screen sharing feature.

thanks,the problem have been resolved

monkeyttttt commented 5 months ago

remove localParticipant.setScreenShare(enabled: true) to

room.connect(wsURL, token).then { room in room. localParticipant?.setScreenShare(enabled: true) }.catch { error in // failed to connect }

solved the problem