File tree Expand file tree Collapse file tree 1 file changed +21
-24
lines changed Expand file tree Collapse file tree 1 file changed +21
-24
lines changed Original file line number Diff line number Diff line change @@ -485,40 +485,37 @@ class _MaterialDesktopControlsState extends State<MaterialDesktopControls>
485
485
void _onExpandCollapse () {
486
486
setState (() {
487
487
notifier.hideStuff = true ;
488
+ });
488
489
489
- chewieController.toggleFullScreen ();
490
- _showAfterExpandCollapseTimer =
491
- Timer ( const Duration (milliseconds : 300 ), () {
492
- setState ( () {
493
- _cancelAndRestartTimer ();
494
- } );
490
+ chewieController.toggleFullScreen ();
491
+
492
+ _showAfterExpandCollapseTimer =
493
+ Timer ( const Duration (milliseconds : 300 ), () {
494
+ setState (() {
495
+ _cancelAndRestartTimer ( );
495
496
});
496
497
});
497
498
}
498
499
499
500
void _playPause () {
500
- final isFinished = _latestValue.position >= _latestValue.duration;
501
-
502
- setState (() {
503
- if (controller.value.isPlaying) {
501
+ if (controller.value.isPlaying) {
502
+ setState (() {
504
503
notifier.hideStuff = false ;
505
- _hideTimer? .cancel ();
506
- controller.pause ();
507
- } else {
508
- _cancelAndRestartTimer ();
504
+ });
509
505
510
- if (! controller.value.isInitialized) {
511
- controller.initialize ().then ((_) {
512
- controller.play ();
513
- });
514
- } else {
515
- if (isFinished) {
516
- controller.seekTo (Duration .zero);
517
- }
506
+ _hideTimer? .cancel ();
507
+ controller.pause ();
508
+ } else {
509
+ _cancelAndRestartTimer ();
510
+
511
+ if (! controller.value.isInitialized) {
512
+ controller.initialize ().then ((_) {
518
513
controller.play ();
519
- }
514
+ });
515
+ } else {
516
+ controller.play ();
520
517
}
521
- });
518
+ }
522
519
}
523
520
524
521
void _startHideTimer () {
You can’t perform that action at this time.
0 commit comments