Go Live On Social Media - Flutter
This feature allows participant to broadcast room on various social media platforms such as Facebook or Youtube. This guide will provide an overview of how participant can start and stop broadcasting room.
- Start LiveStream - By using
startLivestream()
function, a participant can start broadcasting room on various platforms by provding url and stream keys as an argument.
Parameters​
-
outputs
- type:
Array
- required:
true
- It will the array of object containing the url and stream keys.
- type:
-
config:
- type:
Object
- config:
- layout:
- type: "GRID" | "SPOTLIGHT" | "SIDEBAR"
- priority: "SPEAKER" | "PIN"
- gridSize: Number `max 4`
- theme: "DARK" | "LIGHT" | "DEFAULT"
- layout:
- config:
- required:
false
- It will be config for the layout of the recording you can to use.
- type:
- Stop LiveStream - By using
stopLivestream()
function, a participant can stop broadcasting on all platforms.
Start And Stop Live Stream​
// Start Live Stream
room.startLivestream([
{
url: "rtmp://a.rtmp.youtube.com/live2",
streamKey: "streamKey1",
},
], config: {
'layout': {
'type': 'GRID',
'priority': 'SPEAKER',
'gridSize': 4,
},
'theme': "LIGHT",
});
// Stop Live Stream
room?.stopLivestream();
Events​
- livestreamStateChanged - Whenever broadcasting of meeting started / stopped,
livestreamStateChanged
event will trigger.
room.on(Events.liveStreamStateChanged, (String status) {
//Status can have values:
// LIVESTREAM_STARTING -- Live Stream is starting
// LIVESTREAM_STARTED -- Live Stream has started
// LIVESTREAM_STOPPING -- Live Stream is stopping
// LIVESTREAM_STOPPED -- Live Stream has stopped
toastMsg("Meeting live streaming status : $status");
});
Got a Question? Ask us on discord