-
Notifications
You must be signed in to change notification settings - Fork 2
/
main.dart
44 lines (37 loc) · 1.13 KB
/
main.dart
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
import "package:flutter/material.dart";
import "package:video_controls/video_controls.dart";
const String url = "https://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4";
class HomePage extends StatefulWidget {
@override
HomePageState createState() => HomePageState();
}
class HomePageState extends State<HomePage> {
final VideoController controller = VideoController.network(url);
@override
Widget build(BuildContext context) => Scaffold(
appBar: AppBar(title: const Text("video_controls Demo")),
body: Center(
child: ConstrainedBox(
constraints: const BoxConstraints(maxWidth: 750),
child: ListView(
padding: const EdgeInsets.all(10),
children: [
Text(
"My Video",
textAlign: TextAlign.center,
style: Theme.of(context).textTheme.headline3
),
const SizedBox(height: 30),
VideoPlayer(controller),
]
)
)
)
);
@override
void dispose() {
controller.dispose();
super.dispose();
}
}
void main() => runApp(MaterialApp(home: HomePage()));