Swiftpack.co - apivideo/api.video-swift-live-stream as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
See all packages published by apivideo.
apivideo/api.video-swift-live-stream v1.3.5
iOS RTMP live stream client. Made with ♥ by api.video
⭐️ 26
🕓 7 weeks ago
iOS macOS
.package(url: "https://github.com/apivideo/api.video-swift-live-stream.git", from: "v1.3.5")

badge   badge   badge

Swift RTMP live stream client for iOS

api.video is the video infrastructure for product builders. Lightning fast video APIs for integrating, scaling, and managing on-demand & low latency live streaming features in your app.

Table of contents

Project description

This module is an easy way to broadcast RTMP live stream to api.video platform

Getting started


Swift Package Manager

In the Project Navigator select your own project. Then select the project in the Project section and click on the Package Dependencies tab. Click on the "+" button at the bottom. Paste the below url on the search bar on the top right. Finaly click on "Add package" button.


Or add this in your Package.swift

  dependencies: [
        .package(url: "https://github.com/api.video-swift-live-stream.git", from: "1.3.5"),


  1. Add the following entry to your Podfile:
pod 'ApiVideoLiveStream', '1.3.5'
  1. Then run pod install
  2. Don’t forget to import ApiVideoLiveStream in every file you’d like to use api.video live stream library


github "apivideo/ApiVideoLiveStream.swift" ~> 1.3.5


To be able to broadcast, you must update Info.plist with a usage description for camera and microphone

<string>Your own description of the purpose</string>
<string>Your own description of the purpose</string>

Code sample

  1. In ViewController.swift import the library
import ApiVideoLiveStream
  1. Create a ApiVideoLiveStream object with your default audio and video configuration
class ViewController: UIViewController {
    var liveStream:  ApiVideoLiveStream?
    @IBOutlet var viewCamera: UIView!
    override func viewDidLoad() {
        let audioConfig = AudioConfig(bitrate: 32 * 1000)
        let videoConfig = VideoConfig(bitrate: 2 * 1024 * 1024, resolution: Resolutions.RESOLUTION_720, fps: 30)
        do {
            liveStream = try ApiVideoLiveStream(initialAudioConfig: audioConfig, initialVideoConfig: videoConfig, preview: preview)
        } catch {
            print (error)
  1. Start your live stream with startStreaming
liveStream?.startStreaming(streamKey: "YOUR_STREAM_KEY")

Alternatively, you can use startStreaming url parameter to set the URL of your RTMP server.


api.video sdk is using external library

HaishinKit https://github.com/shogo4405/HaishinKit.swift


If you have any questions, ask us here: https://community.api.video . Or use Issues.

Also feel free to test our Sample app.


Stars: 26
Last commit: 1 week ago
Advertisement: IndiePitcher.com - Cold Email Software for Startups

Release Notes

23 weeks ago
  • Fix detach camera
  • Upgrade HaishinKit to 1.5.2

Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics