Swift Live stream Library
api.video Swift Live stream Library
This module is an easy way to broadcast live stream on api.video platform
Installation
With Cocoapods
- Add the following entry to your Podfile:
pod ‘LiveStreamIos’
- Then run
pod install
- Don’t forget to import LiveStreamIos in every file you’d like to use api.video livestream library
Permissions
To be able to broadcast, you must update Info.plist with a usage description for camera and microphone
...
NSCameraUsageDescription
Your own description of the purpose
NSMicrophoneUsageDescription
Your own description of the purpose
...
Quick Start
-
In your ViewController.swift file import the library
-
Add a viariable apiVideo
-
Intenciate your variable with a view (or not if you dont want a preview of your stream)
-
to start your stream use startLiveStreamFlux() function
- if you're broadcasting on api.video you only have to add your stream key to liveStreamKey, and nil for rtmpServerUrl)
- if not add your rtmp server url to rtmpServerUrl
class ViewController: UIViewController { var apiVideo: ApiVideoLiveStream? @IBOutlet var viewCamera: UIView! override }
By default your stream will be
- 720p
- 30 fps
- back camera
- landscape
- microphone : on
Plugins
API.Video sdk is using external library
Plugin | README |
---|---|
HaishinKit | https://github.com/shogo4405/HaishinKit.swift |
FAQ
If you have any questions, ask us here: https://community.api.video . Or use Issues.
License
MIT License Copyright (c) 2021 api.video
Was this page helpful?