Skip to content

Commit

Permalink
Merge pull request #8 from apivideo/bugfix/ios_random_aspect_ratio
Browse files Browse the repository at this point in the history
fix(ios): re-order HaishinKit configuration to fix random aspect rati…
  • Loading branch information
ThibaultBee authored May 31, 2022
2 parents 44e8962 + 311a77c commit 83bdea7
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions ios/Classes/ApiVideoLiveStream.swift
Original file line number Diff line number Diff line change
Expand Up @@ -89,23 +89,22 @@ public class ApiVideoLiveStream{
}
NotificationCenter.default.addObserver(self, selector: #selector(on(_:)), name: UIDevice.orientationDidChangeNotification, object: nil)

attachCamera()
prepareVideo()
attachAudio()
prepareAudio()

preview.attachStream(rtmpStream)

attachCamera()
attachAudio()
preview.attachStream(rtmpStream)
}

private func attachCamera() {
rtmpStream.captureSettings[.isVideoMirrored] = camera == .front
rtmpStream.attachCamera(DeviceUtil.device(withPosition: camera)) { error in
print("======== Camera error ==========")
print(error.description)
}
}

private func prepareVideo() {
rtmpStream.captureSettings = [
.sessionPreset: AVCaptureSession.Preset.high,
Expand Down

0 comments on commit 83bdea7

Please sign in to comment.