File tree 2 files changed +13
-2
lines changed
2 files changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -46,10 +46,14 @@ class CustomControls extends StatefulWidget {
46
46
///Video title
47
47
final String ? title;
48
48
49
+ ///If is offline, then don't show controls
50
+ final bool isOffline;
51
+
49
52
const CustomControls ({
50
53
Key ? key,
51
54
required this .onControlsVisibilityChanged,
52
55
required this .controlsConfiguration,
56
+ required this .isOffline,
53
57
this .title,
54
58
}) : super (key: key);
55
59
@@ -260,7 +264,10 @@ class _CustomControlsState extends BetterPlayerControlsState<CustomControls> {
260
264
_buildTitle ()
261
265
else
262
266
const SizedBox (),
263
- _buildQualitySelector (),
267
+ if (widget.isOffline)
268
+ const SizedBox ()
269
+ else
270
+ _buildQualitySelector (),
264
271
if (_controlsConfiguration.enablePip)
265
272
_buildPipButtonWrapperWidget (
266
273
controlsNotVisible, _onPlayerHide)
@@ -324,7 +331,9 @@ class _CustomControlsState extends BetterPlayerControlsState<CustomControls> {
324
331
return Padding (
325
332
padding: const EdgeInsets .only (left: 8 , right: 8 ),
326
333
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 ,
328
337
child: AutoSizeText (
329
338
widget.title! ,
330
339
maxLines: 1 ,
Original file line number Diff line number Diff line change @@ -2209,6 +2209,7 @@ class _BetterPlayerVideoPlayerState extends State<BetterPlayerVideoPlayer> {
2209
2209
CustomControls (
2210
2210
onControlsVisibilityChanged: onPlayerVisibilityChanged,
2211
2211
controlsConfiguration: controlsConfiguration,
2212
+ isOffline: true ,
2212
2213
title: widget.videoUrls['name' ],
2213
2214
),
2214
2215
playerTheme: BetterPlayerTheme .custom,
@@ -2292,6 +2293,7 @@ class _BetterPlayerVideoPlayerState extends State<BetterPlayerVideoPlayer> {
2292
2293
CustomControls (
2293
2294
onControlsVisibilityChanged: onPlayerVisibilityChanged,
2294
2295
controlsConfiguration: controlsConfiguration,
2296
+ isOffline: false ,
2295
2297
title: widget.videoUrls['name' ],
2296
2298
),
2297
2299
playerTheme: BetterPlayerTheme .custom,
You can’t perform that action at this time.
0 commit comments