Skip to content

Commit b210365

Browse files
authored
chore: test default video player controls (#1370)
Ref #1345
1 parent 513f4aa commit b210365

File tree

2 files changed

+26
-11
lines changed

2 files changed

+26
-11
lines changed

lib/player/view/full_height_player.dart

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,16 @@ class FullHeightPlayer extends StatelessWidget with WatchItMixin {
4242

4343
final Widget body;
4444
if (isVideo) {
45-
body = FullHeightVideoPlayer(playerPosition: playerPosition);
45+
body = Stack(
46+
alignment: Alignment.topRight,
47+
children: [
48+
const SimpleFullHeightVideoPlayer(),
49+
FullHeightPlayerTopControls(
50+
iconColor: iconColor,
51+
playerPosition: playerPosition,
52+
),
53+
],
54+
);
4655
} else {
4756
final queueOrHistory = audio?.audioType == AudioType.radio
4857
? const SizedBox(

lib/player/view/full_height_video_player.dart

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -105,17 +105,23 @@ class FullHeightVideoPlayer extends StatelessWidget with WatchItMixin {
105105
),
106106
],
107107
),
108-
child: Padding(
109-
padding: context.isPortrait && isMobile
110-
? const EdgeInsets.only(bottom: 40)
111-
: EdgeInsets.zero,
112-
child: RepaintBoundary(
113-
child: Video(
114-
controller: di<PlayerModel>().controller,
115-
controls: (state) => MaterialVideoControls(state),
116-
),
117-
),
108+
child: SimpleFullHeightVideoPlayer(
109+
controls: (state) => MaterialVideoControls(state),
118110
),
119111
);
120112
}
121113
}
114+
115+
class SimpleFullHeightVideoPlayer extends StatelessWidget {
116+
const SimpleFullHeightVideoPlayer({super.key, this.controls});
117+
118+
final Widget Function(VideoState)? controls;
119+
120+
@override
121+
Widget build(BuildContext context) => Padding(
122+
padding: context.isPortrait && isMobile
123+
? const EdgeInsets.only(bottom: 40)
124+
: EdgeInsets.zero,
125+
child: Video(controller: di<PlayerModel>().controller, controls: controls),
126+
);
127+
}

0 commit comments

Comments
 (0)