Skip to content

Commit

Permalink
Merge pull request #55 from ant-media/pass_degradation_before_creatin…
Browse files Browse the repository at this point in the history
…g_sender

Pass degradation preference before creating sender
  • Loading branch information
mekya authored Jun 5, 2024
2 parents 72c40b0 + 790f6e4 commit ea381f9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 2 additions & 2 deletions WebRTCiOSSDK/api/AntMediaClient.swift
Original file line number Diff line number Diff line change
Expand Up @@ -508,10 +508,10 @@ open class AntMediaClient: NSObject, AntMediaClientProtocol {
if (self.webRTCClientMap[id] == nil) {
AntMediaClient.printf("Has wsClient? (start) : \(String(describing: self.webRTCClientMap[id]))")

self.webRTCClientMap[id] = WebRTCClient.init(remoteVideoView: remoteView, localVideoView: localView, delegate: self, mode: mode != .unspecified ? mode : self.mode , cameraPosition: self.cameraPosition, targetWidth: self.targetWidth, targetHeight: self.targetHeight, videoEnabled: self.videoEnable, enableDataChannel: self.enableDataChannel, useExternalCameraSource: self.useExternalCameraSource, externalAudio: self.externalAudioEnabled, externalVideoCapture: self.externalVideoCapture, cameraSourceFPS: self.cameraSourceFPS, streamId:id);
self.webRTCClientMap[id] = WebRTCClient.init(remoteVideoView: remoteView, localVideoView: localView, delegate: self, mode: mode != .unspecified ? mode : self.mode , cameraPosition: self.cameraPosition, targetWidth: self.targetWidth, targetHeight: self.targetHeight, videoEnabled: self.videoEnable, enableDataChannel: self.enableDataChannel, useExternalCameraSource: self.useExternalCameraSource, externalAudio: self.externalAudioEnabled, externalVideoCapture: self.externalVideoCapture, cameraSourceFPS: self.cameraSourceFPS, streamId:id,
degradationPreference: self.degradationPreference);

self.webRTCClientMap[id]?.setToken(token)
self.webRTCClientMap[id]?.setDegradationPreference(degradationPreference: self.degradationPreference);

AntMediaClient.rtcAudioSession.add(self);
}
Expand Down
4 changes: 3 additions & 1 deletion WebRTCiOSSDK/api/webrtc/WebRTCClient.swift
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,8 @@ class WebRTCClient: NSObject {
mode: mode, cameraPosition: cameraPosition, targetWidth: targetWidth, targetHeight: targetHeight, videoEnabled: true, enableDataChannel:false, useExternalCameraSource: false, streamId: streamId)
}

public convenience init(remoteVideoView: RTCVideoRenderer?, localVideoView: RTCVideoRenderer?, delegate: WebRTCClientDelegate, mode: AntMediaClientMode, cameraPosition: AVCaptureDevice.Position, targetWidth: Int, targetHeight: Int, videoEnabled: Bool, enableDataChannel: Bool, useExternalCameraSource: Bool, externalAudio: Bool = false, externalVideoCapture: Bool = false, cameraSourceFPS: Int = 30, streamId: String) {
public convenience init(remoteVideoView: RTCVideoRenderer?, localVideoView: RTCVideoRenderer?, delegate: WebRTCClientDelegate, mode: AntMediaClientMode, cameraPosition: AVCaptureDevice.Position, targetWidth: Int, targetHeight: Int, videoEnabled: Bool, enableDataChannel: Bool, useExternalCameraSource: Bool, externalAudio: Bool = false, externalVideoCapture: Bool = false, cameraSourceFPS: Int = 30, streamId: String,
degradationPreference: RTCDegradationPreference = RTCDegradationPreference.maintainResolution) {
self.init(remoteVideoView: remoteVideoView, localVideoView: localVideoView, delegate: delegate, externalAudio: externalAudio)
self.cameraPosition = cameraPosition
self.targetWidth = targetWidth
Expand All @@ -105,6 +106,7 @@ class WebRTCClient: NSObject {
self.externalVideoCapture = externalVideoCapture;
self.cameraSourceFPS = cameraSourceFPS;
self.streamId = streamId;
self.degradationPreference = degradationPreference

if (mode != .play) {
self.addLocalMediaStream()
Expand Down

0 comments on commit ea381f9

Please sign in to comment.