Fix screen size calculation

This commit is contained in:
Tiago Jacobs 2022-04-05 14:52:47 -03:00
parent b97e1d46fd
commit 0f10961c81
2 changed files with 1 additions and 1 deletions

BIN
example/ios/music2.mp3 Normal file

Binary file not shown.

View File

@ -144,7 +144,7 @@ open class WebRTCClient: NSObject {
public func setRatio(originalWidth: Int32, originalHeight: Int32) {
let targetWidth:Int32 = 600;
let targetHeight:Int32 = targetWidth * Int32(originalHeight / originalWidth)
let targetHeight:Int32 = Int32( Double(targetWidth) * ( Double(originalHeight) / Double(originalWidth) ) )
videoSource!.adaptOutputFormat(toWidth: targetWidth, height: targetHeight, fps: 15)
self.isRatioDefined = true;