Skip to content

Commit

Permalink
[player] again, hotfix...
Browse files Browse the repository at this point in the history
  • Loading branch information
BrightDV committed Jan 11, 2025
1 parent 12735be commit 6e688dd
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
13 changes: 11 additions & 2 deletions lib/helpers/custom_player_controls.dart
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,14 @@ class CustomControls extends StatefulWidget {
///Video title
final String? title;

///If is offline, then don't show controls
final bool isOffline;

const CustomControls({
Key? key,
required this.onControlsVisibilityChanged,
required this.controlsConfiguration,
required this.isOffline,
this.title,
}) : super(key: key);

Expand Down Expand Up @@ -260,7 +264,10 @@ class _CustomControlsState extends BetterPlayerControlsState<CustomControls> {
_buildTitle()
else
const SizedBox(),
_buildQualitySelector(),
if (widget.isOffline)
const SizedBox()
else
_buildQualitySelector(),
if (_controlsConfiguration.enablePip)
_buildPipButtonWrapperWidget(
controlsNotVisible, _onPlayerHide)
Expand Down Expand Up @@ -324,7 +331,9 @@ class _CustomControlsState extends BetterPlayerControlsState<CustomControls> {
return Padding(
padding: const EdgeInsets.only(left: 8, right: 8),
child: SizedBox(
width: MediaQuery.of(context).size.width - 56 - 75,
width: widget.isOffline
? MediaQuery.of(context).size.width - 56
: MediaQuery.of(context).size.width - 56 - 75,
child: AutoSizeText(
widget.title!,
maxLines: 1,
Expand Down
2 changes: 2 additions & 0 deletions lib/helpers/news.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2209,6 +2209,7 @@ class _BetterPlayerVideoPlayerState extends State<BetterPlayerVideoPlayer> {
CustomControls(
onControlsVisibilityChanged: onPlayerVisibilityChanged,
controlsConfiguration: controlsConfiguration,
isOffline: true,
title: widget.videoUrls['name'],
),
playerTheme: BetterPlayerTheme.custom,
Expand Down Expand Up @@ -2292,6 +2293,7 @@ class _BetterPlayerVideoPlayerState extends State<BetterPlayerVideoPlayer> {
CustomControls(
onControlsVisibilityChanged: onPlayerVisibilityChanged,
controlsConfiguration: controlsConfiguration,
isOffline: false,
title: widget.videoUrls['name'],
),
playerTheme: BetterPlayerTheme.custom,
Expand Down

0 comments on commit 6e688dd

Please sign in to comment.