Go Live On Social Media - iOS
This feature allows participant to broadcast meeting on various social media platforms such as Facebook or Youtube. This guide will provide an overview of how participant can start and stop broadcasting meeting.
- Start LiveStream - By using
startLivestream()
function, a participant can start broadcasting meeting on various platforms by provding url and stream keys as an argument. - Stop LiveStream - By using
stopLivestream()
function, a participant can stop broadcasting on all platforms.
Start And Stop Live Stream
/// keep track of livestream
private var livestreamStarted = false
@IBAction func livestreamButtonTapped(_ sender: Any) {
if !livestreamStarted {
// prepare output
// specify social-media-url and stream-key
let output = LivestreamOutput(url: "<rtmp://a.rtmp.youtube.com/live2>", streamKey: "<stream-key>")
// start livestream
self.meeting?.startLivestream(outputs: [output])
}
else {
// stop livestream
self.meeting?.stopLivestream()
}
}
Events
-
livestream-started - Whenever broadcasting of meeting started,
livestream-started
event will trigger. -
livestream-stopped - Whenever broadcasting of meeting stopped,
livestream-stopped
event will trigger.
/// Called after livestream starts
func onLivestreamStarted() {
liveStreamStarted = true
// show indication that livestream is started
}
/// Called after livestream stops
func onLivestreamStopped() {
liveStreamStarted = false
// hide livestream indication
}
Got a Question? Ask us on discord