Skip to main content
Version: 1.1.x

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.

  1. 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.
  • config:

    • type: Object
      • config:
        • layout:
          • type: "GRID" | "SPOTLIGHT" | "SIDEBAR"
          • priority: "SPEAKER" | "PIN"
          • gridSize: Number `max 4`
        • theme: "DARK" | "LIGHT" | "DEFAULT"
    • required: false
    • It will be config for the layout of the recording you can to use.
  1. 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

  1. 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