Closed sauravkure closed 2 years ago
Any update on this issue?
Hi @sauravkure, hope you are well. Did you achieve screen broadcast functionality with twillio?
Yes, screen broadcast functionality implemented successfully in app but shared screen video on participant end is showing distorted.
@sauravkure can you please provide a sample of the screen broadcast? In my case, we are connecting group calls from the main app, on the click of the broadcast picker button we are calling video broadcast from the extension, but for that, we have to rejoin the video call from the extension. Once I get connected from the extension my screen is shared with others but others' video is blank for me.
Could you please help?
Please check below code for connnecting shared video in Group call:
`override func broadcastStarted(withSetupInfo setupInfo: [String : NSObject]?) { processToConnectFromRoom() } private func processToConnectFromRoom() { SampleHandlerConstants.getTwilioAccessTokenForScreenShare { accessToken, error in guard let lAccessToken = accessToken, !lAccessToken.isEmpty else { print("ScreenShare-Debug broadcastStarted getTwilioAccessTokenForScreenShare = (String(describing: error)) ") return } self.connectToRoom(lAccessToken) } }
private func connectToRoom(_ pAccessToken : String? = nil)
{
guard let lAccessToken = pAccessToken, !lAccessToken.isEmpty else {
return
}
self.accessToken = lAccessToken
let options = ReplayKitVideoSource.TelecineOptions.p30to24or25 5
let (encodingParams, outputFormat) = ReplayKitVideoSource.getParametersForUseCase(codec: SampleHandler.kVideoCodec,
isScreencast: false,
telecineOptions: options)
videoSource = ReplayKitVideoSource(isScreencast: false, telecineOptions: options)
screenTrack = LocalVideoTrack(source: videoSource!,
enabled: true,
name: SampleHandlerConstants.K_SCREEN)
videoSource!.requestOutputFormat(outputFormat)
let connectOptions = ConnectOptions(token: accessToken) { (builder) in
builder.videoTracks = [self.screenTrack!]
builder.preferredVideoCodecs = [SampleHandler.kVideoCodec]
builder.encodingParameters = encodingParams
builder.isAutomaticSubscriptionEnabled = false
builder.region = SampleHandlerConstants.K_REGION
if let lRoomName = SampleHandlerConstants.getContentFromUserDefault(SampleHandlerConstants.ROOM_NAME) as? String,
!lRoomName.isEmpty
{
builder.roomName=lRoomName
}
}
room = TwilioVideoSDK.connect(options: connectOptions, delegate: self)
}`
If you need more support then please ping me over s_k_y_p_e (sauravsinha1707)
Description
Video Quality is bad at receiver end during the screen sharing using ReplayKit in iOS I am using ReplayKit for sharing screen. I have created broadcast extension in which I have added "ReplayKitVideoSource.swift" and "SampleHandler.swift" file. Integrated screen sharing feature in our app properly but at receiver end video quality is not so good. I need to improve quality of video during screen sharing. Please help me to find out the solution of this issue.
Steps to Reproduce
Code