iOS Broadcast SDK
UZBroadcast is a framework helps you to broadcast livestream
UZBroadcast requires Swift 4.2+ and iOS 9+
Then run the following command:
let broadcaster = UZBroadcastViewController()
let config = UZBroadcastConfig(cameraPosition: .front, videoResolution: ._720, videoBitrate: ._3000, videoFPS: ._30, audioBitrate: ._128Kbps, audioSampleRate: ._44_1khz, adaptiveBitrate: true)
broadcaster.prepareForBroadcast(withConfig: config)
//...
broadcaster.startBroadcast(broadcastURL: BROADCAST_URL)
present(broadcaster, animated: true, completion: nil)
let broadcaster = UZScreenBroadcast.shared
let config = UZBroadcastConfig(cameraPosition: .front, videoResolution: ._720, videoBitrate: ._3000, videoFPS: ._30, audioBitrate: ._128Kbps, audioSampleRate: ._44_1khz, adaptiveBitrate: true)
broadcaster.prepareForBroadcast(withConfig: config)s
broadcaster.isMicrophoneEnabled = true
//broadcaster.isCameraEnabled = true
broadcaster.startBroadcast(broadcastURL: BROADCAST_URL)
Remember to add these usage description keys into
Info.plist
file:<key>NSCameraUsageDescription</key>
<string>App needs access to camera for broadcasting</string>
<key>NSMicrophoneUsageDescription</key>
<string>App needs access to microphone for broadcasting</string>
Last modified 3yr ago