Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release 1.10.2: Develop to main #1768

Merged
merged 16 commits into from
May 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ jobs:
- uses: subosito/flutter-action@v2
with:
channel: stable
flutter-version: 3.13.9
cache: true
- name: Get Flutter dependencies in Core SDK
run: flutter pub get
Expand Down
2 changes: 1 addition & 1 deletion .java-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
openjdk64-17.0.10
openjdk64-17.0.11
19 changes: 19 additions & 0 deletions packages/hms_room_kit/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,25 @@
| hms_room_kit | [![Pub Version](https://img.shields.io/pub/v/hms_room_kit)](https://pub.dev/packages/hms_room_kit) |
| hmssdk_flutter | [![Pub Version](https://img.shields.io/pub/v/hmssdk_flutter)](https://pub.dev/packages/hmssdk_flutter) |

## 1.1.2 - 2024-05-15

| Package | Version |
| -------------- | ------------------------------------------------------------------------------------------------------ |
| hms_room_kit | 1.1.2 |
| hmssdk_flutter | 1.10.2 |

### 🚀 Added

- Whiteboard support in Prebuilt

Prebuilt now supports whiteboard for better collaboration. Users can create, manage, and stop whiteboards directly from the prebuilt interface.

- Introducing option to select layers in HLS Player

HLS Player now supports layer selection from HLS Player Settings.

Uses `hmssdk_flutter` package version 1.10.2

## 1.1.1 - 2024-04-26

| Package | Version |
Expand Down
16 changes: 8 additions & 8 deletions packages/hms_room_kit/example/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,16 @@ PODS:
- HMSHLSPlayerSDK (0.0.2):
- HMSAnalyticsSDK (= 0.0.2)
- HMSNoiseCancellationModels (1.0.0)
- HMSSDK (1.8.0):
- HMSSDK (1.9.0):
- HMSAnalyticsSDK (= 0.0.2)
- HMSWebRTC (= 1.0.5118)
- hmssdk_flutter (1.10.0):
- HMSWebRTC (= 1.0.6168)
- hmssdk_flutter (1.10.1):
- Flutter
- HMSBroadcastExtensionSDK (= 0.0.9)
- HMSHLSPlayerSDK (= 0.0.2)
- HMSNoiseCancellationModels (= 1.0.0)
- HMSSDK (= 1.8.0)
- HMSWebRTC (1.0.5118)
- HMSSDK (= 1.9.0)
- HMSWebRTC (1.0.6168)
- path_provider_foundation (0.0.1):
- Flutter
- FlutterMacOS
Expand Down Expand Up @@ -68,9 +68,9 @@ SPEC CHECKSUMS:
HMSBroadcastExtensionSDK: d80fe325f6c928bd8e5176290b5a4b7ae15d6fbb
HMSHLSPlayerSDK: 6a54ad4d12f3dc2270d1ecd24019d71282a4f6a3
HMSNoiseCancellationModels: a3bda1405a16015632f4bcabd46ce48f35103b02
HMSSDK: c893d1381a47ed02760ef6d06625b9aa5251f998
hmssdk_flutter: 997715f0bedfcb22750fb95549672bf3fea380ff
HMSWebRTC: 4487c7200f1e9358412c1d8cd974edd2766467dc
HMSSDK: 96bdafc1c610aabfecd1155ad7e3c1bc45b3a6cb
hmssdk_flutter: c2ad70779ed9355577afbbe1047fb20f862820ac
HMSWebRTC: a302f0d6c94f7bee94f3265adb7bb1c6569e7ee5
path_provider_foundation: 3784922295ac71e43754bd15e0653ccfd36a147c
permission_handler_apple: e76247795d700c14ea09e3a2d8855d41ee80a2e6
share_plus: c3fef564749587fc939ef86ffb283ceac0baf9f5
Expand Down
70 changes: 67 additions & 3 deletions packages/hms_room_kit/example/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -206,15 +206,15 @@ packages:
path: ".."
relative: true
source: path
version: "1.1.1"
version: "1.1.2"
hmssdk_flutter:
dependency: transitive
description:
name: hmssdk_flutter
sha256: bfa6e6ec411d6f86f6cc054936fb2163c4cd3f8703f8848099689652b3794376
sha256: b3f1438c5146afe0399935d78820357bf548b0e3ea36f9355878670ccc2aca6e
url: "https://pub.dev"
source: hosted
version: "1.10.1"
version: "1.10.2"
http:
dependency: transitive
description:
Expand Down Expand Up @@ -439,6 +439,38 @@ packages:
url: "https://pub.dev"
source: hosted
version: "2.1.8"
pointer_interceptor:
dependency: transitive
description:
name: pointer_interceptor
sha256: bd18321519718678d5fa98ad3a3359cbc7a31f018554eab80b73d08a7f0c165a
url: "https://pub.dev"
source: hosted
version: "0.10.1"
pointer_interceptor_ios:
dependency: transitive
description:
name: pointer_interceptor_ios
sha256: "2e73c39452830adc4695757130676a39412a3b7f3c34e3f752791b5384770877"
url: "https://pub.dev"
source: hosted
version: "0.10.0+2"
pointer_interceptor_platform_interface:
dependency: transitive
description:
name: pointer_interceptor_platform_interface
sha256: "0597b0560e14354baeb23f8375cd612e8bd4841bf8306ecb71fcd0bb78552506"
url: "https://pub.dev"
source: hosted
version: "0.10.0+1"
pointer_interceptor_web:
dependency: transitive
description:
name: pointer_interceptor_web
sha256: "2a8a069206f7b234a895d30ccab8b18ea267eeb79a832e5e3d1b6464d659eb6a"
url: "https://pub.dev"
source: hosted
version: "0.10.0"
pointycastle:
dependency: transitive
description:
Expand Down Expand Up @@ -724,6 +756,38 @@ packages:
url: "https://pub.dev"
source: hosted
version: "0.1.4-beta"
webview_flutter:
dependency: transitive
description:
name: webview_flutter
sha256: d81b68e88cc353e546afb93fb38958e3717282c5ac6e5d3be4a4aef9fc3c1413
url: "https://pub.dev"
source: hosted
version: "4.5.0"
webview_flutter_android:
dependency: transitive
description:
name: webview_flutter_android
sha256: dad3313c9ead95517bb1cae5e1c9d20ba83729d5a59e5e83c0a2d66203f27f91
url: "https://pub.dev"
source: hosted
version: "3.16.1"
webview_flutter_platform_interface:
dependency: transitive
description:
name: webview_flutter_platform_interface
sha256: d937581d6e558908d7ae3dc1989c4f87b786891ab47bb9df7de548a151779d8d
url: "https://pub.dev"
source: hosted
version: "2.10.0"
webview_flutter_wkwebview:
dependency: transitive
description:
name: webview_flutter_wkwebview
sha256: "4d062ad505390ecef1c4bfb6001cd857a51e00912cc9dfb66edb1886a9ebd80c"
url: "https://pub.dev"
source: hosted
version: "3.10.2"
win32:
dependency: transitive
description:
Expand Down
2 changes: 1 addition & 1 deletion packages/hms_room_kit/example/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ publish_to: "none" # Remove this line if you wish to publish to pub.dev
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
# In Windows, build-name is used as the major, minor, and patch parts
# of the product and file versions while build-number is used as the build suffix.
version: 1.1.1
version: 1.1.2

environment:
sdk: ">=2.19.6 <3.0.0"
Expand Down
3 changes: 3 additions & 0 deletions packages/hms_room_kit/lib/src/hls_viewer/hls_player.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import 'package:hmssdk_flutter/hmssdk_flutter.dart';
import 'package:provider/provider.dart';

///Project imports
import 'package:hms_room_kit/src/hls_viewer/hls_stats_view.dart';
import 'package:hms_room_kit/src/hls_viewer/hls_player_store.dart';
import 'package:hms_room_kit/src/meeting/meeting_store.dart';
import 'package:hms_room_kit/src/hls_viewer/hls_player_overlay_options.dart';
Expand Down Expand Up @@ -68,6 +69,8 @@ class HLSPlayer extends StatelessWidget {
})
: Center(child: const HLSWaitingUI()),

const HLSStatsView(),

///This renders the overlay controls for HLS Player
Align(
alignment: Alignment.center,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,12 @@ class _HLSPlayerSeekbarState extends State<HLSPlayerSeekbar> {
hlsPlayerStore.timeFromLive, hlsPlayerStore.rollingWindow),
builder: (_, data, __) {
maxValue = data.item2.inSeconds;
seekBarValue = maxValue > 0 ? maxValue - data.item1.inSeconds : 0;

///We only subtract the time from live from the rolling window if the time from live is greater than 0
seekBarValue = maxValue > 0
? maxValue -
(data.item1.inSeconds > 0 ? data.item1.inSeconds : 0)
: 0;
minValue = 0;
return (maxValue > 0 && seekBarValue > 0)
? SliderTheme(
Expand Down
59 changes: 58 additions & 1 deletion packages/hms_room_kit/lib/src/hls_viewer/hls_player_store.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import 'dart:io';
///Package imports
import 'package:flutter/material.dart';
import 'package:hmssdk_flutter/hmssdk_flutter.dart';
import 'package:collection/collection.dart';

///Project imports
import 'package:hms_room_kit/src/layout_api/hms_room_layout.dart';
Expand Down Expand Up @@ -75,6 +76,10 @@ class HLSPlayerStore extends ChangeNotifier

String? caption;

Map<String, HMSHLSLayer> layerMap = {};

HMSHLSLayer? selectedLayer;

///This method starts a timer for 5 seconds and then hides the buttons
///
///[isStreamPlaying] is used to check if the video is playing or not
Expand Down Expand Up @@ -215,6 +220,56 @@ class HLSPlayerStore extends ChangeNotifier
notifyListeners();
}

///[getHLSLayers] gets the HLS Layers
void getHLSLayers() async {
var layers = await HMSHLSPlayerController.getHLSLayers();
int layersSize = layers.length;
if (layersSize > 0) {
///This sorts the layers in descending order of bitrate
layers.sort((a, b) => (b.bitrate ?? 0).compareTo(a.bitrate ?? 0));

///This checks for layer with zero or null bitrate and sets it to
///"AUTO" key
if (layers[layersSize - 1].bitrate == 0 ||
layers[layersSize - 1].bitrate == null) {
layerMap["AUTO"] = layers[layersSize - 1];
}

///This picks up the highest bitrate layer from the sorted layers
layerMap["HIGH"] = layers[0];

///This picks up the mid layer from the sorted layers
layerMap["MEDIUM"] = layers[layersSize ~/ 2];

///This picks up the lowest bitrate layer from the sorted layers
if (layersSize > 1) {
layerMap["LOW"] = layers[layersSize - 2];
}
}
}

///[getCurrentHLSLayer] gets the current HLS Layer
void getCurrentHLSLayer() async {
var layer = await HMSHLSPlayerController.getCurrentHLSLayer();

///Here we are finding the layer with the same bitrate as the current layer
var layerSelected = layerMap.entries.firstWhereIndexedOrNull(
(index, element) => (element.value.bitrate == layer?.bitrate));

///If the layer is found we set the selected layer to that layer
if (layerSelected != null) {
selectedLayer = layerSelected.value;
}
notifyListeners();
}

///[setHLSLayer] sets the HLS Layer
void setHLSLayer(HMSHLSLayer hmsHLSLayer) async {
selectedLayer = hmsHLSLayer;
HMSHLSPlayerController.setHLSLayer(hmsHLSLayer: hmsHLSLayer);
notifyListeners();
}

@override
void onCue({required HMSHLSCue hlsCue}) {}

Expand All @@ -223,7 +278,7 @@ class HLSPlayerStore extends ChangeNotifier

@override
void onHLSEventUpdate({required HMSHLSPlayerStats playerStats}) {
log("onHLSEventUpdate-> distanceFromLive: ${playerStats.distanceFromLive} buffered duration: ${playerStats.bufferedDuration}");
log("onHLSEventUpdate-> distanceFromLive: ${playerStats.distanceFromLive}ms buffered duration: ${playerStats.bufferedDuration}ms bitrate: ${playerStats.averageBitrate}");
isLive = playerStats.distanceFromLive < timeBeforeLive;
timeFromLive = Duration(milliseconds: playerStats.distanceFromLive.toInt());
hlsPlayerStats = playerStats;
Expand All @@ -244,6 +299,8 @@ class HLSPlayerStore extends ChangeNotifier
areClosedCaptionsSupported();
setHLSPlayerStats(true);
startTimer();
getHLSLayers();
getCurrentHLSLayer();
isStreamPlaying = true;
isPlayerFailed = false;
break;
Expand Down
Loading
Loading