EdgeCenter Demo – Stream Live Video Online on IOS
Introduction
Set up live streaming in 15 minutes in your IOS project instead of 7 days of work and setting wild parameters of codecs, network, etc. This demo project is a quick tutorial how to stream live video from your own mobile app to an audience of 1 000 000+ viewers like Instagram, Youtube, etc.
Features
- Authorization
- HLS & MPEG-DASH playback
- RTMP streaming
- Creating a new live stream
- Camera switching
- Mute mode
- Video:
- Network adaptive bitrate mechanism
- Source: front and back cameras
- Orientation: portrait
- Codec: AVC/H.264
- Configurable bitrate, resolution, iFrameInterval, encoder profile
-
Audio:
- You can clone this project and run it in Xcode, where you can test it either by connecting a real device or through an IOS emulator
- Sign in with your EdgeCenter account email and password.
- On the Streams screen, you can watch the available streams
- On the Select stream screen, you can select/create a stream to start streaming
- On the Start Broadcast screen, you can start broadcasting, set the video quality, and select push url or backup push url for streaming
Screenshots
Quick Start
1. Permissions
In order to broadcast, you will also need an internet connection, a background mode, a camera and a microphone. To use them, add the following permissions to your app’s Info.plist file:
<key>NSCameraUsageDescription</key>
<string>Allow record video</string>
<key>NSMicrophoneUsageDescription</key>
<string>Allow record microphone</string>
<key>UIApplicationSupportsIndirectInputEvents</key>
<true/>
<key>UIBackgroundModes</key>
<array>
<string>audio</string>
2. Start streaming
Streaming with default params:
let rtmpManager = RTMPStreamManager()
rtmpManager.start()
rtmpManager.play()
rtmpManager.close()
You can find out how to get rtmpUrl for streaming in the EdgeCenter API documentation.
Requirements
- The presence of an Internet connection on the device
- The presence of a camera and microphone on the device.
-
IOS 12.1 or newer
License
MIT License
Copyright (c) 2023 Edge-Center
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.