diff --git a/WebRTCiOSSDK/api/AntMediaClient.swift b/WebRTCiOSSDK/api/AntMediaClient.swift index 77e606a..5c623f7 100644 --- a/WebRTCiOSSDK/api/AntMediaClient.swift +++ b/WebRTCiOSSDK/api/AntMediaClient.swift @@ -1110,6 +1110,16 @@ open class AntMediaClient: NSObject, AntMediaClientProtocol { } } + public func forceStreamQuality(resolutionHeight:Int, streamId:String) { + if (self.isWebSocketConnected) + { + self.webSocket?.write(string: [COMMAND: FORCE_STREAM_QUALITY_INFO, STREAM_ID: (self.playerStreamId!), TRACK_ID:streamId, STREAM_HEIGHT_FIELD: resolutionHeight].json) + } + else { + AntMediaClient.printf("Websocket is not connected") + } + } + public func registerStatsListener(for streamId:String, timeInterval:Double = 5) { self.rtcStatsTimer?.invalidate(); diff --git a/WebRTCiOSSDK/api/AntMediaClientProtocol.swift b/WebRTCiOSSDK/api/AntMediaClientProtocol.swift index 285d96a..18ac219 100644 --- a/WebRTCiOSSDK/api/AntMediaClientProtocol.swift +++ b/WebRTCiOSSDK/api/AntMediaClientProtocol.swift @@ -260,6 +260,12 @@ public protocol AntMediaClientProtocol { If the resolution is set to 0, then automatic stream quality will be used according to the measured network speed. */ func forStreamQuality(resolutionHeight:Int); + + /** + - resolutionHeight: The height to be forced. If you set the height to zero, it will become auto + - streamId: The streamId or subtrack Id to change the resolution + */ + func forceStreamQuality(resolutionHeight:Int, streamId:String) /** It get webrtc statistis and calls completionHandler. There is a sample code for below to get the audio level in the application latyer