example-ios-live-streaming
An example app for live streaming from an iOS device using the Mux live streaming service, written in Swift.
Welcome
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.
Quick Start
Sample Project Setup
After cloning this project and installing CocoaPods, run the following command from the project directory to get setup:
make setup && make pods
Then just open the workspace and click play to build and run.
open *workspace
Components
MuxLive.swift
is a component that provides the basic network streaming capabilities and properties for configuration.MuxLiveConfiguration.swift
describesMuxLive.swift
‘s configuration properties.MuxBroadcastViewController.swift
provides a simple camera user interface and wrapsMuxLive.swift
, providing examples on how to useMuxLive.swift
directly (if that is preferred).
Integration
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.
Documentation
You can find the docs here. Documentation is generated with jazzy and hosted on GitHub-Pages.
Resources
- 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
License
example-ios-live-streaming
and MuxLive
are available under the MIT license, see the LICENSE file for more information.