simple_video_player 0.0.5+2
simple_video_player: ^0.0.5+2 copied to clipboard
A Simple video player built with material design to enhance developer and user experience
example/lib/main.dart
import 'package:flutter/material.dart';
import 'package:simple_video_player/simple_video_player.dart';
void main() {
runApp(const App());
}
class App extends StatelessWidget {
const App({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
debugShowCheckedModeBanner: false,
title: 'Simple Video Player Example',
theme: ThemeData(useMaterial3: true),
home: const Example(),
);
}
}
class Example extends StatefulWidget {
const Example({super.key});
@override
State<Example> createState() => _ExampleState();
}
class _ExampleState extends State<Example> {
final String _url =
'https://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4';
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(title: Text('Simple Video Player Example')),
body: Center(
child: AspectRatio(
aspectRatio: 1.5,
child: SimpleVideoPlayer(
// path: 'local_file_path',
url: _url,
autoPlay: false,
loop: false,
themeColor: Colors.deepPurple,
// showThumbnailOnly: true, // Use to show only the thumbnail image
),
),
),
);
}
}