From 43d5b84e8ee744824df303fc4d79a73ae2462252 Mon Sep 17 00:00:00 2001 From: Decoder07 Date: Thu, 14 Dec 2023 13:53:48 +0530 Subject: [PATCH] Fixed HLS Stream URL --- .../live/hms/hmssdk_flutter/HmssdkFlutterPlugin.kt | 9 +++------ .../ios/Classes/SwiftHmssdkFlutterPlugin.swift | 8 ++++---- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/packages/hmssdk_flutter/android/src/main/kotlin/live/hms/hmssdk_flutter/HmssdkFlutterPlugin.kt b/packages/hmssdk_flutter/android/src/main/kotlin/live/hms/hmssdk_flutter/HmssdkFlutterPlugin.kt index bcbc71617..06fb32e83 100644 --- a/packages/hmssdk_flutter/android/src/main/kotlin/live/hms/hmssdk_flutter/HmssdkFlutterPlugin.kt +++ b/packages/hmssdk_flutter/android/src/main/kotlin/live/hms/hmssdk_flutter/HmssdkFlutterPlugin.kt @@ -38,10 +38,7 @@ import live.hms.video.events.AgentType import live.hms.video.media.tracks.* import live.hms.video.sdk.* import live.hms.video.sdk.models.* -import live.hms.video.sdk.models.enums.AudioMixingMode -import live.hms.video.sdk.models.enums.HMSPeerUpdate -import live.hms.video.sdk.models.enums.HMSRoomUpdate -import live.hms.video.sdk.models.enums.HMSTrackUpdate +import live.hms.video.sdk.models.enums.* import live.hms.video.sdk.models.role.HMSRole import live.hms.video.sdk.models.trackchangerequest.HMSChangeTrackStateRequest import live.hms.video.sessionstore.HMSKeyChangeListener @@ -1205,7 +1202,7 @@ class HmssdkFlutterPlugin : * the stream URL. */ room.hlsStreamingState?.let { streamingState -> - if (streamingState.running) { + if (streamingState.state == HMSStreamingState.STARTED) { streamingState.variants?.let { variants -> if (variants.isNotEmpty()) { hlsStreamUrl = variants[0].hlsStreamUrl @@ -1274,7 +1271,7 @@ class HmssdkFlutterPlugin : */ if (type == HMSRoomUpdate.HLS_STREAMING_STATE_UPDATED) { hmsRoom.hlsStreamingState?.let { streamingState -> - if (streamingState.running) { + if (streamingState.state == HMSStreamingState.STARTED) { streamingState.variants?.let { variants -> if (variants.isNotEmpty()) { hlsStreamUrl = variants[0].hlsStreamUrl diff --git a/packages/hmssdk_flutter/ios/Classes/SwiftHmssdkFlutterPlugin.swift b/packages/hmssdk_flutter/ios/Classes/SwiftHmssdkFlutterPlugin.swift index cc60287fb..158e8d361 100644 --- a/packages/hmssdk_flutter/ios/Classes/SwiftHmssdkFlutterPlugin.swift +++ b/packages/hmssdk_flutter/ios/Classes/SwiftHmssdkFlutterPlugin.swift @@ -1200,9 +1200,9 @@ public class SwiftHmssdkFlutterPlugin: NSObject, FlutterPlugin, HMSUpdateListene * the stream URL. */ - if room.hlsStreamingState.running { + if room.hlsStreamingState.state == HMSStreamingState.started { if !room.hlsStreamingState.variants.isEmpty { - hlsStreamUrl = room.hlsStreamingState.variants[0].url?.absoluteString + hlsStreamUrl = room.hlsStreamingState.variants.first?.url?.absoluteString } } @@ -1225,9 +1225,9 @@ public class SwiftHmssdkFlutterPlugin: NSObject, FlutterPlugin, HMSUpdateListene * the stream URL. */ - if room.hlsStreamingState.running { + if room.hlsStreamingState.state == HMSStreamingState.started { if !room.hlsStreamingState.variants.isEmpty { - hlsStreamUrl = room.hlsStreamingState.variants[0].url?.absoluteString + hlsStreamUrl = room.hlsStreamingState.variants.first?.url?.absoluteString } }