Skip to content

Commit

Permalink
Add parameter to set the subtrack resolutions
Browse files Browse the repository at this point in the history
  • Loading branch information
mekya committed Jul 15, 2024
1 parent 6ae3316 commit 9d4ee9c
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
10 changes: 10 additions & 0 deletions WebRTCiOSSDK/api/AntMediaClient.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down
6 changes: 6 additions & 0 deletions WebRTCiOSSDK/api/AntMediaClientProtocol.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 9d4ee9c

Please sign in to comment.