startLivestream method
Future<void>
startLivestream(
- dynamic outputs, {
- Map<
String, dynamic> ? config, - PostTranscriptionConfig? postTranscriptionConfig,
Starts livestreaming the current room session.
- This method allows you to broadcast the room to external platforms such as YouTube, Facebook, or any other service that supports RTMP streaming.
When livestreaming starts successfully, all participants, including the local participant, will receive a Events.liveStreamStarted event.
Parameters
-
outputs: A list of RTMP destinations to which the livestream will be sent. Each item in the list must contain:url: The RTMP server URL (for example, YouTube or Facebook RTMP URL)streamKey: The stream key provided by the streaming platform
-
config(optional): A map containing livestream layout and theme configuration:layout
type:"GRID"|"SPOTLIGHT"|"SIDEBAR"priority:"SPEAKER"|"PIN"gridSize: Number (maximum 4)
theme
"DARK"|"LIGHT"|"DEFAULT"
-
postTranscriptionConfig(optional): Configuration for post-livestream transcription and summary generation:enabled: Enables post-transcription processingmodelId: The transcription model identifiersummaryConfig:enabled: Enables summary generationprompt: Custom prompt for generating the summary
Events associated with startLivestream()
Example
final outputs = [
{
'url': 'rtmp://a.rtmp.youtube.com/live2',
'streamKey': '<STREAM_KEY>',
},
{
'url': 'rtmps://',
'streamKey': '<STREAM_KEY>',
},
];
final livestreamConfig = {
'layout': {
'type': 'GRID',
'priority': 'SPEAKER',
'gridSize': 4,
},
'theme': 'LIGHT',
};
final postTranscriptionConfig = PostTranscriptionConfig(
enabled: true,
modelId: 'raman_v1',
summaryConfig: SummaryConfig(
enabled: true,
prompt:
'Write summary in sections like Title, Agenda, Speakers, '
'Action Items, Outlines, Notes and Summary',
),
);
await room.startLivestream(
outputs,
config: livestreamConfig,
postTranscriptionConfig: postTranscriptionConfig,
);
Implementation
Future<void> startLivestream(outputs,
{Map<String, dynamic>? config,
PostTranscriptionConfig? postTranscriptionConfig}) =>
_startLivestream(
outputs,
config: config,
postTranscriptionConfig: postTranscriptionConfig,
);