-
Notifications
You must be signed in to change notification settings - Fork 76
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1756 from 100mslive/FLUT-265
FLUT-265: HLS Player View
- Loading branch information
Showing
52 changed files
with
1,254 additions
and
465 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 7 additions & 1 deletion
8
packages/hms_room_kit/lib/src/hls_viewer/hls_hand_raise_menu.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
92 changes: 92 additions & 0 deletions
92
packages/hms_room_kit/lib/src/hls_viewer/hls_player_seekbar.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
library; | ||
|
||
///Package imports | ||
import 'package:flutter/material.dart'; | ||
import 'package:hmssdk_flutter/hmssdk_flutter.dart'; | ||
import 'package:provider/provider.dart'; | ||
import 'package:tuple/tuple.dart'; | ||
|
||
///Project imports | ||
import 'package:hms_room_kit/src/meeting/meeting_store.dart'; | ||
import 'package:hms_room_kit/hms_room_kit.dart'; | ||
import 'package:hms_room_kit/src/hls_viewer/hls_player_store.dart'; | ||
|
||
///[HLSPlayerSeekbar] is the seekbar for the HLS Player | ||
class HLSPlayerSeekbar extends StatefulWidget { | ||
@override | ||
State<HLSPlayerSeekbar> createState() => _HLSPlayerSeekbarState(); | ||
} | ||
|
||
class _HLSPlayerSeekbarState extends State<HLSPlayerSeekbar> { | ||
int seekBarValue = 0; | ||
int minValue = 0, maxValue = 300; | ||
bool isInteracting = false; | ||
|
||
///[_toggleIsInteracting] toggles the [isInteracting] variable | ||
void _toggleIsInteracting(bool value) { | ||
setState(() { | ||
isInteracting = value; | ||
}); | ||
} | ||
|
||
@override | ||
void initState() { | ||
super.initState(); | ||
maxValue = context.read<HLSPlayerStore>().rollingWindow.inSeconds; | ||
} | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return (context | ||
.read<MeetingStore>() | ||
.hmsRoom | ||
?.hmshlsStreamingState | ||
?.variants[0] | ||
?.playlistType == | ||
HMSHLSPlaylistType.dvr) | ||
? Selector<HLSPlayerStore, Tuple2<Duration, Duration>>( | ||
selector: (_, hlsPlayerStore) => Tuple2( | ||
hlsPlayerStore.timeFromLive, hlsPlayerStore.rollingWindow), | ||
builder: (_, data, __) { | ||
maxValue = data.item2.inSeconds; | ||
seekBarValue = maxValue > 0 ? maxValue - data.item1.inSeconds : 0; | ||
minValue = 0; | ||
return (maxValue > 0 && seekBarValue > 0) | ||
? SliderTheme( | ||
data: SliderThemeData( | ||
trackHeight: isInteracting ? 6 : 4, | ||
trackShape: RoundedRectSliderTrackShape(), | ||
inactiveTrackColor: HMSThemeColors.baseWhite, | ||
activeTrackColor: HMSThemeColors.primaryDefault, | ||
thumbColor: HMSThemeColors.primaryDefault, | ||
thumbShape: RoundSliderThumbShape( | ||
enabledThumbRadius: isInteracting ? 10 : 6), | ||
overlayShape: | ||
RoundSliderOverlayShape(overlayRadius: 0)), | ||
child: Slider( | ||
value: seekBarValue.toDouble(), | ||
onChanged: (value) {}, | ||
onChangeEnd: (value) { | ||
if (value > seekBarValue) { | ||
HMSHLSPlayerController.seekForward( | ||
seconds: (value - seekBarValue).toInt()); | ||
} else { | ||
HMSHLSPlayerController.seekBackward( | ||
seconds: (seekBarValue - value).toInt()); | ||
} | ||
HMSHLSPlayerController.resume(); | ||
_toggleIsInteracting(false); | ||
}, | ||
onChangeStart: (_) { | ||
HMSHLSPlayerController.pause(); | ||
_toggleIsInteracting(true); | ||
}, | ||
min: minValue.toDouble(), | ||
max: maxValue.toDouble(), | ||
), | ||
) | ||
: const SizedBox(); | ||
}) | ||
: const SizedBox(); | ||
} | ||
} |
Oops, something went wrong.