simple_player 2.1.0
simple_player: ^2.1.0 copied to clipboard
SimplePlayer offers all the essential tools for viewing videos in your mobile applications in a simplified way!
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();
});
Result: #


FullScreen: #
