mirror of
https://github.com/ALEZ-DEV/Babylonia-terminal.git
synced 2026-03-21 21:58:52 +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(),
|
const Background(),
|
||||||
SizedBox(
|
SizedBox(
|
||||||
child: Align(
|
child: Align(
|
||||||
alignment: Alignment.bottomCenter,
|
alignment: Alignment.bottomRight,
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: const EdgeInsets.only(bottom: 50),
|
padding: const EdgeInsets.only(right: 50, bottom: 50),
|
||||||
child: FilledButton(
|
child: ElevatedButton(
|
||||||
|
style: ElevatedButton.styleFrom(
|
||||||
|
backgroundColor: Colors.blue[500],
|
||||||
|
),
|
||||||
onPressed: () {},
|
onPressed: () {},
|
||||||
child: const SizedBox(
|
child: const SizedBox(
|
||||||
width: 300,
|
width: 300,
|
||||||
|
|||||||
@ -10,7 +10,9 @@ class Background extends StatefulWidget {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class _BackgroundState extends State<Background> {
|
class _BackgroundState extends State<Background> {
|
||||||
late final player = Player();
|
late final player = Player(
|
||||||
|
configuration: PlayerConfiguration(),
|
||||||
|
);
|
||||||
late final controller = VideoController(player);
|
late final controller = VideoController(player);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@ -21,6 +23,7 @@ class _BackgroundState extends State<Background> {
|
|||||||
'https://media-cdn-zspms.kurogame.net/pnswebsite/website2.0/video/1715184000000/1l5uvj9eqpjjcazt4p-1715219648481.mp4',
|
'https://media-cdn-zspms.kurogame.net/pnswebsite/website2.0/video/1715184000000/1l5uvj9eqpjjcazt4p-1715219648481.mp4',
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
player.setPlaylistMode(PlaylistMode.loop);
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@ -32,6 +35,11 @@ class _BackgroundState extends State<Background> {
|
|||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
player.play();
|
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