# iOS Broadcast SDK

[![Swift](https://camo.githubusercontent.com/066a529725eadc4f422543c3500d924fe5dfc6e1/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f253230696e2d7377696674253230352e302d6f72616e67652e737667)](https://camo.githubusercontent.com/066a529725eadc4f422543c3500d924fe5dfc6e1/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f253230696e2d7377696674253230352e302d6f72616e67652e737667)

UZBroadcast is a framework helps you to broadcast livestream

Link to the Source code here: <https://github.com/uizaio/snake.sdk.ios-broadcast>

## Compatibility

UZBroadcast requires Swift 4.2+ and iOS 9+

## Installation

### CocoaPods

To integrate UZBroadcast into your Xcode project using [CocoaPods](http://cocoapods.org/), specify it in your `Podfile`:

Then run the following command:

## Livestream

```
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)
```

## Screen broadcast

```
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>
```

## Reference

[API Reference](https://uizaio.github.io/uiza-ios-broadcast-sdk/)

## Support

<namnh@uiza.io>

## License

UZBroadcast is released under the BSD license. See [LICENSE](https://github.com/uizaio/uiza-sdk-broadcast-ios/blob/master/LICENSE) for details.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.uiza.io/2022-06-06/sdk-reference/ios-sdk/ios-broadcast-sdk.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
