An example app for live streaming from an iOS device using the Mux live streaming service, written in Swift.
Our sample app uses a couple open source projects and Xcode configurations in order to get live streaming up and running quickly. To make this easy, we recommend using the CocoaPods dependency manager for iOS. Once you have cloned this repo and installed CocoaPods, you are a couple steps away from streaming.
After cloning this project and installing CocoaPods, run the following command from the project directory to get setup:
make setup && make podsThen just open the workspace and click play to build and run.
open *workspace-
MuxLive.swiftis a component that provides the basic network streaming capabilities and properties for configuration. -
MuxLiveConfiguration.swiftdescribesMuxLive.swift's configuration properties. -
MuxBroadcastViewController.swiftprovides a simple camera user interface and wrapsMuxLive.swift, providing examples on how to useMuxLive.swiftdirectly (if that is preferred).
If you'd like to integrate these components into your app directly (instead of using them as a reference), you can follow along with the code from the sample project's 'ViewController.swift' and install all the source files in the following ways:
# CocoaPods (not current supported! maybe? we have to figure that out.)
pod "MuxLive", "~> 0.0.1"
# Carthage
github "muxinc/example-ios-live-streaming" ~> 0.0.1
# Swift PM
let package = Package(
dependencies: [
.Package(url: "https://github.com/muxinc/example-ios-live-streaming", majorVersion: 0)
]
)Alternatively, you can just copy all the source files into your Xcode project.
You can find the docs here. Documentation is generated with jazzy and hosted on GitHub-Pages.
- Mux
- Mux Live Streaming Documentation
- Demuxed
- Swift Evolution
- NextLevel Media Capture Library
- Streambox Web-based HLS video player
- ijkplayer Streaming video player for RTMP
- LFLiveKit RTMP Streaming SDK
example-ios-live-streaming and MuxLive are available under the MIT license, see the LICENSE file for more information.