Skip to content

Commit 6e688dd

Browse files
committed
[player] again, hotfix...
1 parent 12735be commit 6e688dd

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

lib/helpers/custom_player_controls.dart

+11-2
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,14 @@ class CustomControls extends StatefulWidget {
4646
///Video title
4747
final String? title;
4848

49+
///If is offline, then don't show controls
50+
final bool isOffline;
51+
4952
const CustomControls({
5053
Key? key,
5154
required this.onControlsVisibilityChanged,
5255
required this.controlsConfiguration,
56+
required this.isOffline,
5357
this.title,
5458
}) : super(key: key);
5559

@@ -260,7 +264,10 @@ class _CustomControlsState extends BetterPlayerControlsState<CustomControls> {
260264
_buildTitle()
261265
else
262266
const SizedBox(),
263-
_buildQualitySelector(),
267+
if (widget.isOffline)
268+
const SizedBox()
269+
else
270+
_buildQualitySelector(),
264271
if (_controlsConfiguration.enablePip)
265272
_buildPipButtonWrapperWidget(
266273
controlsNotVisible, _onPlayerHide)
@@ -324,7 +331,9 @@ class _CustomControlsState extends BetterPlayerControlsState<CustomControls> {
324331
return Padding(
325332
padding: const EdgeInsets.only(left: 8, right: 8),
326333
child: SizedBox(
327-
width: MediaQuery.of(context).size.width - 56 - 75,
334+
width: widget.isOffline
335+
? MediaQuery.of(context).size.width - 56
336+
: MediaQuery.of(context).size.width - 56 - 75,
328337
child: AutoSizeText(
329338
widget.title!,
330339
maxLines: 1,

lib/helpers/news.dart

+2
Original file line numberDiff line numberDiff line change
@@ -2209,6 +2209,7 @@ class _BetterPlayerVideoPlayerState extends State<BetterPlayerVideoPlayer> {
22092209
CustomControls(
22102210
onControlsVisibilityChanged: onPlayerVisibilityChanged,
22112211
controlsConfiguration: controlsConfiguration,
2212+
isOffline: true,
22122213
title: widget.videoUrls['name'],
22132214
),
22142215
playerTheme: BetterPlayerTheme.custom,
@@ -2292,6 +2293,7 @@ class _BetterPlayerVideoPlayerState extends State<BetterPlayerVideoPlayer> {
22922293
CustomControls(
22932294
onControlsVisibilityChanged: onPlayerVisibilityChanged,
22942295
controlsConfiguration: controlsConfiguration,
2296+
isOffline: false,
22952297
title: widget.videoUrls['name'],
22962298
),
22972299
playerTheme: BetterPlayerTheme.custom,

0 commit comments

Comments
 (0)