Simple Player 🎬
Welcome to the simplest user-friendly player ever made!
Applicable preferences:
- Label (String)
- AspectRatio (double)
- AutoPlay (bool)
- LoopMode (bool)
- ForceAspectRatio (bool)
- ColorAccent (Color)
/// Example:
SimpleController simpleController = SimpleController();
String url =
'https://flutter.github.io/assets-for-api-docs/assets/videos/bee.mp4';
SimplePlayer(
simpleController: simpleController,
simplePlayerSettings: SimplePlayerSettings.network(
path: url,
label: 'Bee',
aspectRatio: 16 / 9,
autoPlay: false,
loopMode: true,
forceAspectRatio: false,
colorAccent: Colors.red,
),
),
SimplePlayer(
simpleController: simpleController,
simplePlayerSettings: SimplePlayerSettings.assets(
path: url,
label: 'Bee',
aspectRatio: 16 / 9,
autoPlay: false,
loopMode: true,
forceAspectRatio: false,
colorAccent: Colors.red,
),
),
/// Examples of controller usage:
// Play
simpleController.play();
// Pause
simpleController.pause()
// Get current position (return Duration)
simpleController.position;
// By disposing of the controller
// This method does not need to be called in normal cases, SimplePlayer already has an AutoDispose to facilitate its correct use.
simpleController.delete()
// Hear player position (return Duration)
simpleController.listenPosition().listen((event) {
Duration stremPosition = event.toString();
});