Skip to content

Commit

Permalink
Released hms_room_kit 0.0.5 version
Browse files Browse the repository at this point in the history
  • Loading branch information
Decoder07 committed Aug 3, 2023
1 parent 5a64d70 commit 6dec73c
Show file tree
Hide file tree
Showing 21 changed files with 80 additions and 11 deletions.
2 changes: 1 addition & 1 deletion packages/hms_room_kit/lib/src/enums/meeting_mode.dart
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
//enum to set the meeting flow
///enum to set the meeting flow
enum MeetingMode { single, hero, grid, audio, activeSpeaker, oneToOne }
6 changes: 3 additions & 3 deletions packages/hms_room_kit/lib/src/enums/session_store_keys.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//Enum to store the session metadata keys
// PINNED_MESSAGE_SESSION_KEY: for pinning messages
// SPOTLIGHT: for adding spotlight feature in application
///Enum to store the session metadata keys
/// PINNED_MESSAGE_SESSION_KEY: for pinning messages
/// SPOTLIGHT: for adding spotlight feature in application
enum SessionStoreKey { pinnedMessageSessionKey, spotlight, unknown }

extension SessionStoreKeyValues on SessionStoreKey {
Expand Down
1 change: 1 addition & 0 deletions packages/hms_room_kit/lib/src/hls_viewer/hls_chat.dart
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import 'package:tuple/tuple.dart';
import 'package:hmssdk_flutter/hmssdk_flutter.dart';
import 'package:url_launcher/url_launcher.dart';

///[HLSChat] is a widget that displays the chat messages while in HLS Viewer mode
class HLSChat extends StatefulWidget {
const HLSChat({super.key});

Expand Down
8 changes: 6 additions & 2 deletions packages/hms_room_kit/lib/src/hls_viewer/hls_player.dart
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
///Package imports
import 'package:flutter/material.dart';
import 'package:hmssdk_flutter/hmssdk_flutter.dart';
import 'package:hms_room_kit/src/hls_viewer/hls_stats_view.dart';
import 'package:hms_room_kit/src/meeting/meeting_store.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/meeting/meeting_store.dart';

///This widget is used to show the HLS Player
///It uses the [HMSHLSPlayer] widget from the [hmssdk_flutter] package
///It also uses the [HLSStatsView] widget to show the stats of the HLS Player
class HLSPlayer extends StatelessWidget {
final double? ratio;
const HLSPlayer({Key? key, this.ratio}) : super(key: key);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:hmssdk_flutter/hmssdk_flutter.dart';

/// HLSPayerStore is a [ChangeNotifier] class which stores the state of the HLSPlayer
/// and notifies the listeners when the state changes
///
/// This class is used to control the state of the HLSPlayer
class HLSPlayerStore extends ChangeNotifier {
///This variable stores whether the application is in full screen or not
bool isFullScreen = false;
Expand Down
4 changes: 4 additions & 0 deletions packages/hms_room_kit/lib/src/hls_viewer/hls_stats_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ import 'package:hms_room_kit/src/common/app_color.dart';
import 'package:hms_room_kit/src/meeting/meeting_store.dart';
import 'package:provider/provider.dart';

///This widget shows the HLS stats of the HLS Stream
///It uses the [MeetingStore] to get the stats
///
///It is used in the [HLSPlayer] widget to show the stats when the user enables the HLS Stats
class HLSStatsView extends StatelessWidget {
const HLSStatsView({super.key});

Expand Down
2 changes: 2 additions & 0 deletions packages/hms_room_kit/lib/src/hls_viewer/hls_viewer_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ import 'package:intl/intl.dart';
import 'package:provider/provider.dart';
import 'package:tuple/tuple.dart';

/// This is the page that is shown when the user is viewing the HLS stream
/// It contains the HLS player and the chat
class HLSViewerPage extends StatefulWidget {
const HLSViewerPage({
Key? key,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import 'package:hms_room_kit/src/common/app_color.dart';
import 'package:hms_room_kit/src/widgets/common_widgets/hms_subheading_text.dart';
import 'package:hms_room_kit/src/widgets/common_widgets/hms_title_text.dart';

///This widget is shown when the HLS Stream hasn't started yet
class HLSWaitingUI extends StatelessWidget {
const HLSWaitingUI({super.key});

Expand Down
4 changes: 4 additions & 0 deletions packages/hms_room_kit/lib/src/hms_prebuilt.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ import 'package:flutter/widgets.dart';
import 'package:hms_room_kit/hms_room_kit.dart';
import 'package:hms_room_kit/src/screen_controller.dart';

/// [HMSPrebuilt] is a widget that contains the prebuilt
/// - [roomCode] is the room code of the room to join
/// - [options] is the options for the prebuilt
/// For more details checkout the [HMSPrebuiltOptions] class
class HMSPrebuilt extends StatelessWidget {
///The room code of the room to join
final String roomCode;
Expand Down
7 changes: 7 additions & 0 deletions packages/hms_room_kit/lib/src/hms_prebuilt_options.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
import 'package:hms_room_kit/hms_room_kit.dart';

/// [HMSPrebuiltOptions] is a class that contains the options for the prebuilt
/// - [userName] is the name of the user
/// - [userId] is the id of the user
/// - [endPoints] is the token and init endpoints
/// - [debugInfo] is to enable the debug mode for the prebuilt
/// - [iOSScreenshareConfig] is the screen share config, to enable screen share for iOS
/// If you wish to enable screen share for iOS, you need to pass this config
class HMSPrebuiltOptions {
//The name of the user
final String? userName;
Expand Down
2 changes: 2 additions & 0 deletions packages/hms_room_kit/lib/src/hmssdk_interactor.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ import 'dart:io';
import 'package:hmssdk_flutter/hmssdk_flutter.dart';
import 'package:hms_room_kit/src/common/utility_functions.dart';

/// [HMSSDKInteractor] is a class that contains the methods to interact with the SDK.
/// It is used to interact with the SDK.
class HMSSDKInteractor {
/// [hmsSDK] is the instance of the HMSSDK class which is used to interact with the SDK.
late HMSSDK hmsSDK;
Expand Down
8 changes: 8 additions & 0 deletions packages/hms_room_kit/lib/src/meeting/meeting_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,14 @@ import 'package:hms_room_kit/src/meeting/pip_view.dart';
import 'package:provider/provider.dart';
import 'package:tuple/tuple.dart';

/// This is the main meeting page which is shown when the user joins a meeting
/// It contains the main meeting UI and the meeting controls
///
/// The meeting UI is divided into 4 modes:
/// 1. [FullScreenMode] - This is the default mode when the user joins the meeting
/// 2. [HeroMode] - This mode is shown when the user taps on a participant's video
/// 3. [OneToOneMode] - This mode is shown when the user taps on a participant's video in [HeroMode]
/// 4. [AudioMode] - This mode is shown when the user taps on the audio button
class MeetingPage extends StatefulWidget {
final String meetingLink;
final bool isRoomMute;
Expand Down
6 changes: 6 additions & 0 deletions packages/hms_room_kit/lib/src/meeting/meeting_store.dart
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,12 @@ import 'package:collection/collection.dart';
//Project imports
import 'package:hmssdk_flutter/hmssdk_flutter.dart';

///Add comments in this class for better understanding
///This class is responsible for storing the data related to the meeting
///This class is also responsible for handling the events from the SDK
///
///This class extends ChangeNotifier so that it can notify the UI when the data changes
///This class has WidgetsBindingObserver mixin so that it can listen to the app lifecycle events
class MeetingStore extends ChangeNotifier
with WidgetsBindingObserver
implements
Expand Down
1 change: 1 addition & 0 deletions packages/hms_room_kit/lib/src/meeting/pip_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import 'package:hms_room_kit/src/widgets/peer_widgets/audio_level_avatar.dart';
import 'package:provider/provider.dart';
import 'package:tuple/tuple.dart';

/// [PipView] is the widget to display the pip view of the meeting
class PipView extends StatefulWidget {
const PipView({super.key});

Expand Down
19 changes: 19 additions & 0 deletions packages/hms_room_kit/lib/src/model/peer_track_node.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,17 @@ import 'package:flutter/foundation.dart';
import 'package:hmssdk_flutter/hmssdk_flutter.dart';
import 'package:hms_room_kit/src/model/rtc_stats.dart';

///This class is used to store the peer and track information
///
///[uid] is the unique id of the peer
///[peer] is the [HMSPeer] object of the peer
///[track] is the [HMSVideoTrack] object of the peer
///[isOffscreen] is used to check if the peer is onscreen or offscreen
///[networkQuality] is the network quality of the peer
///[stats] is the [RTCStats] object of the peer
///[audioLevel] is the audio level of the peer
///[pinTile] is used to check if the peer is pinned or not
///[audioTrack] is the [HMSAudioTrack] object of the peer
class PeerTrackNode extends ChangeNotifier {
HMSPeer peer;
String uid;
Expand Down Expand Up @@ -32,22 +43,26 @@ class PeerTrackNode extends ChangeNotifier {
return 'PeerTrackNode{peerId: ${peer.peerId}, name: ${peer.name}, track: $track}, isVideoOn: $isOffscreen }';
}

///This method is used to notify the listeners
void notify() {
notifyListeners();
}

///This method is used to set whether the peer is onscreen or offscreen
void setOffScreenStatus(bool currentState) {
isOffscreen = currentState;
notify();
}

///This method is used to set the audio level for the peer
void setAudioLevel(int audioLevel) {
this.audioLevel = audioLevel;
if (!isOffscreen) {
notify();
}
}

///This method is used to set the network quality for the peer
void setNetworkQuality(int? networkQuality) {
if (networkQuality != null) {
this.networkQuality = networkQuality;
Expand All @@ -57,27 +72,31 @@ class PeerTrackNode extends ChangeNotifier {
}
}

///This method is used to set the audio stats for the peer
void setHMSRemoteAudioStats(HMSRemoteAudioStats hmsRemoteAudioStats) {
stats?.hmsRemoteAudioStats = hmsRemoteAudioStats;
if (!isOffscreen) {
notify();
}
}

///This method is used to set the video stats for the peer
void setHMSRemoteVideoStats(HMSRemoteVideoStats hmsRemoteVideoStats) {
stats?.hmsRemoteVideoStats = hmsRemoteVideoStats;
if (!isOffscreen) {
notify();
}
}

///This method is used to set the local video stats for the peer
void setHMSLocalVideoStats(List<HMSLocalVideoStats> hmsLocalVideoStats) {
stats?.hmsLocalVideoStats = hmsLocalVideoStats;
if (!isOffscreen) {
notify();
}
}

///This method is used to set the local audio stats for the peer
void setHMSLocalAudioStats(HMSLocalAudioStats hmsLocalAudioStats) {
stats?.hmsLocalAudioStats = hmsLocalAudioStats;
if (!isOffscreen) {
Expand Down
4 changes: 4 additions & 0 deletions packages/hms_room_kit/lib/src/model/rtc_stats.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
//Project imports
import 'package:hmssdk_flutter/hmssdk_flutter.dart';

///This class contains the stats of the room
///It contains the stats of the local peer and the remote peers
///
///For more details checkout the [HMSRemoteAudioStats], [HMSLocalVideoStats], [HMSRemoteVideoStats], [HMSLocalAudioStats] classes
class RTCStats {
HMSRemoteAudioStats? hmsRemoteAudioStats;
List<HMSLocalVideoStats>? hmsLocalVideoStats;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import 'package:hms_room_kit/src/preview/preview_store.dart';
import 'package:hms_room_kit/src/service/app_debug_config.dart';
import 'package:hms_room_kit/src/widgets/common_widgets/hms_title_text.dart';

///[PreviewJoinButton] renders a button depending on the room state and
///[PreviewJoinButton] renders a button depending on the room state and
///user role
///If the user has permission to start the HLS Stream and stream is not already started
///then it renders a button with a live icon and text "Go Live" and on tap it calls join and startHLSStreaming methods
Expand Down
2 changes: 1 addition & 1 deletion packages/hms_room_kit/lib/src/preview/preview_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ import 'package:provider/provider.dart';
///[PreviewPage] is the screen where the user can preview it's camera, mic and audio outputs
///It also provides information about the room and the participants in the room
class PreviewPage extends StatefulWidget {

///[name] is the name of the user joining the room
final String name;

Expand Down Expand Up @@ -132,6 +131,7 @@ class _PreviewPageState extends State<PreviewPage> {
context: context, error: error);
}
return Scaffold(
backgroundColor: backgroundDefault,
resizeToAvoidBottomInset: false,
body: previewStore.isRoomJoinedAndHLSStarted
? ListenableProvider.value(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ class _PreviewPermissionsState extends State<PreviewPermissions> {
@override
Widget build(BuildContext context) {
Size size = MediaQuery.of(context).size;
return SizedBox(
return Container(
color: backgroundDefault,
width: size.width,
height: size.height,
child: Stack(
Expand Down
1 change: 1 addition & 0 deletions packages/hms_room_kit/lib/src/screen_controller.dart
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ class _ScreenControllerState extends State<ScreenController> {
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: backgroundDefault,
body: isLoading
? Center(
child: CircularProgressIndicator(
Expand Down
4 changes: 2 additions & 2 deletions packages/hms_room_kit/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
name: hms_room_kit
description: 100ms Room Kit provides simple & easy to use UI components to build Live Streaming & Video Conferencing experiences in your apps.
version: 0.0.4
version: 0.0.5
homepage: https://www.100ms.live/
repository: https://github.com/100mslive/100ms-flutter/tree/feature/prebuilt/packages/hms_room_kit
repository: https://github.com/100mslive/100ms-flutter
issue_tracker: https://github.com/100mslive/100ms-flutter/issues
documentation: https://www.100ms.live/docs

Expand Down

0 comments on commit 6dec73c

Please sign in to comment.