HLS Events - Flutter
VideoSDK provides the hlsStateChanged
event, which informs you about the current state of HLS for the meeting.
Events.hlsStateChanged​
- This event is triggered when the HLS status of the meeting changes.
- It can be subscribed to using the
Room
Object.
note
downstreamUrl
is now depecated. Use playbackHlsUrl
or livestreamUrl
in place of downstreamUrl
Example​
Here is an example demonstrating the usage of the event mentioned on this page.
import 'dart:developer';
import 'package:flutter/material.dart';
import 'package:videosdk/videosdk.dart';
class MeetingScreen extends StatefulWidget {
//Existing configuration
}
class _MeetingScreenState extends State<MeetingScreen> {
late Room room;
@override
void initState() {
//Existing configuration
setupRoomEventListener();
}
@override
Widget build(BuildContext context) {
return YourMeetingWidget();
}
void setupRoomEventListener() {
room.on(Events.hlsStateChanged, (Map<String, dynamic> data) {
//Status can be :: HLS_STARTING
//Status can be :: HLS_STARTED
//Status can be :: HLS_PLAYABLE
//Status can be :: HLS_STOPPING
//Status can be :: HLS_STOPPED
log("Meeting HLS status : ${data['status']}");
if (data['status'] == "HLS_PLAYABLE") {
log("PLAYBACKHLS URL -- ${data['playbackHlsUrl']}");
}
});
}
}
API Reference​
The API references for all the methods and events utilized in this guide are provided below.
Got a Question? Ask us on discord