From eb9063dc35d34731f92e685c06012adfab2ec019 Mon Sep 17 00:00:00 2001 From: Decoder07 Date: Mon, 29 Apr 2024 12:32:38 +0530 Subject: [PATCH] Added required changes --- packages/hms_room_kit/example/pubspec.lock | 7 +++---- .../hms_room_kit/lib/src/hls_viewer/hls_player_store.dart | 6 ++++-- packages/hms_room_kit/pubspec.lock | 7 +++---- packages/hms_room_kit/pubspec.yaml | 3 ++- .../live/hms/hmssdk_flutter/HMSHLSLayerExtension.kt | 8 +++++--- .../lib/src/model/hls_player/hms_hls_layer.dart | 2 +- 6 files changed, 18 insertions(+), 15 deletions(-) diff --git a/packages/hms_room_kit/example/pubspec.lock b/packages/hms_room_kit/example/pubspec.lock index 5013a3708..1b25a2167 100644 --- a/packages/hms_room_kit/example/pubspec.lock +++ b/packages/hms_room_kit/example/pubspec.lock @@ -210,10 +210,9 @@ packages: hmssdk_flutter: dependency: transitive description: - name: hmssdk_flutter - sha256: bfa6e6ec411d6f86f6cc054936fb2163c4cd3f8703f8848099689652b3794376 - url: "https://pub.dev" - source: hosted + path: "../../hmssdk_flutter" + relative: true + source: path version: "1.10.1" http: dependency: transitive diff --git a/packages/hms_room_kit/lib/src/hls_viewer/hls_player_store.dart b/packages/hms_room_kit/lib/src/hls_viewer/hls_player_store.dart index b42eed5c2..7c5064ad4 100644 --- a/packages/hms_room_kit/lib/src/hls_viewer/hls_player_store.dart +++ b/packages/hms_room_kit/lib/src/hls_viewer/hls_player_store.dart @@ -215,8 +215,9 @@ class HLSPlayerStore extends ChangeNotifier notifyListeners(); } - void getHLSLayers(){ - HMSHLSPlayerController.getHLSLayers(); + void getHLSLayers() async { + var layers = await HMSHLSPlayerController.getHLSLayers(); + log("Layers are $layers"); } @override @@ -248,6 +249,7 @@ class HLSPlayerStore extends ChangeNotifier areClosedCaptionsSupported(); setHLSPlayerStats(true); startTimer(); + getHLSLayers(); isStreamPlaying = true; isPlayerFailed = false; break; diff --git a/packages/hms_room_kit/pubspec.lock b/packages/hms_room_kit/pubspec.lock index 287ab5d9f..a483faed0 100644 --- a/packages/hms_room_kit/pubspec.lock +++ b/packages/hms_room_kit/pubspec.lock @@ -187,10 +187,9 @@ packages: hmssdk_flutter: dependency: "direct main" description: - name: hmssdk_flutter - sha256: bfa6e6ec411d6f86f6cc054936fb2163c4cd3f8703f8848099689652b3794376 - url: "https://pub.dev" - source: hosted + path: "../hmssdk_flutter" + relative: true + source: path version: "1.10.1" http: dependency: transitive diff --git a/packages/hms_room_kit/pubspec.yaml b/packages/hms_room_kit/pubspec.yaml index c9ffea667..82cf4efa9 100644 --- a/packages/hms_room_kit/pubspec.yaml +++ b/packages/hms_room_kit/pubspec.yaml @@ -14,7 +14,8 @@ dependencies: flutter: sdk: flutter - hmssdk_flutter: 1.10.1 + hmssdk_flutter: + path: ../hmssdk_flutter intl: ^0.18.0 permission_handler: ^11.0.0 provider: ^6.0.5 diff --git a/packages/hmssdk_flutter/android/src/main/kotlin/live/hms/hmssdk_flutter/HMSHLSLayerExtension.kt b/packages/hmssdk_flutter/android/src/main/kotlin/live/hms/hmssdk_flutter/HMSHLSLayerExtension.kt index e66addf07..0385bf5dd 100644 --- a/packages/hmssdk_flutter/android/src/main/kotlin/live/hms/hmssdk_flutter/HMSHLSLayerExtension.kt +++ b/packages/hmssdk_flutter/android/src/main/kotlin/live/hms/hmssdk_flutter/HMSHLSLayerExtension.kt @@ -11,10 +11,12 @@ class HMSHLSLayerExtension { return null; } val map = HashMap() + if(hmsHLSLayer == HmsHlsLayer.AUTO){ + return map + } (hmsHLSLayer as HmsHlsLayer.LayerInfo?)?.let { - map["resolution"] = HMSVideoResolutionExtension.toDictionary(it.resolution) - map["bitrate"] = it.bitrate - + map["resolution"] = HMSVideoResolutionExtension.toDictionary(it.resolution) + map["bitrate"] = it.bitrate } return map } diff --git a/packages/hmssdk_flutter/lib/src/model/hls_player/hms_hls_layer.dart b/packages/hmssdk_flutter/lib/src/model/hls_player/hms_hls_layer.dart index b0dc05f4d..55b4a9dc2 100644 --- a/packages/hmssdk_flutter/lib/src/model/hls_player/hms_hls_layer.dart +++ b/packages/hmssdk_flutter/lib/src/model/hls_player/hms_hls_layer.dart @@ -6,7 +6,7 @@ class HMSHLSLayer { HMSHLSLayer({this.resolution, this.bitrate}); - factory HMSHLSLayer.fromMap(Map map){ + factory HMSHLSLayer.fromMap(Map map){ return HMSHLSLayer( resolution: map['resolution'] != null? HMSResolution.fromMap(map['resolution']):null, bitrate: map['bitrate']