Skip to content

Commit

Permalink
Fixed HLS Stream URL (#1666)
Browse files Browse the repository at this point in the history
  • Loading branch information
Decoder07 authored Dec 14, 2023
1 parent a2c2fbd commit 003445f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}

Expand All @@ -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
}
}

Expand Down

0 comments on commit 003445f

Please sign in to comment.