mirror of
https://github.com/ALEZ-DEV/Babylonia-terminal.git
synced 2025-12-16 01:18:50 +00:00
video can now loop
This commit is contained in:
parent
08740a4988
commit
6d4087539e
@ -12,10 +12,13 @@ class HomeScreen extends StatelessWidget {
|
||||
const Background(),
|
||||
SizedBox(
|
||||
child: Align(
|
||||
alignment: Alignment.bottomCenter,
|
||||
alignment: Alignment.bottomRight,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.only(bottom: 50),
|
||||
child: FilledButton(
|
||||
padding: const EdgeInsets.only(right: 50, bottom: 50),
|
||||
child: ElevatedButton(
|
||||
style: ElevatedButton.styleFrom(
|
||||
backgroundColor: Colors.blue[500],
|
||||
),
|
||||
onPressed: () {},
|
||||
child: const SizedBox(
|
||||
width: 300,
|
||||
|
||||
@ -10,7 +10,9 @@ class Background extends StatefulWidget {
|
||||
}
|
||||
|
||||
class _BackgroundState extends State<Background> {
|
||||
late final player = Player();
|
||||
late final player = Player(
|
||||
configuration: PlayerConfiguration(),
|
||||
);
|
||||
late final controller = VideoController(player);
|
||||
|
||||
@override
|
||||
@ -21,6 +23,7 @@ class _BackgroundState extends State<Background> {
|
||||
'https://media-cdn-zspms.kurogame.net/pnswebsite/website2.0/video/1715184000000/1l5uvj9eqpjjcazt4p-1715219648481.mp4',
|
||||
),
|
||||
);
|
||||
player.setPlaylistMode(PlaylistMode.loop);
|
||||
}
|
||||
|
||||
@override
|
||||
@ -32,6 +35,11 @@ class _BackgroundState extends State<Background> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
player.play();
|
||||
return Video(controller: controller);
|
||||
return Video(
|
||||
controller: controller,
|
||||
controls: NoVideoControls,
|
||||
wakelock: false,
|
||||
fit: BoxFit.cover,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user