efui_video_player 1.0.4
efui_video_player: ^1.0.4 copied to clipboard
A custom Flutter video player powered by empathetech_flutter_ui
EFUI Video Player #
A versatile video player Widget powered by Empathetech's accessible Flutter UI!
Table of Contents #
Installation #
In your app's base directory, run
flutter pub add efui_video_player
And add the following import to any files that use the video player!
import 'package:efui_video_player/efui_video_player.dart';
Usage #
Provide EzVideoPlayer with a VideoPlayerController
@override
void didChangeDependencies() {
super.didChangeDependencies();
_initializeVideoController();
}
late final VideoPlayerController _videoController;
void _initializeVideoController() {
_videoController = VideoPlayerController.asset(
videoPath,
videoPlayerOptions: VideoPlayerOptions(
allowBackgroundPlayback: false,
mixWithOthers: false,
),
)..initialize().then((_) {
setState(() {
// Required or Chrome will get mad
_videoController.setVolume(0.0);
});
});
}
Then, customize EzVideoPlayer based on your needs
@override
Widget build(BuildContext context) {
return Scaffold(
body: EzScreen(
decoration: BoxDecoration(color: offBlack),
margin: EdgeInsets.zero,
child: _videoController.value.isInitialized
? EzVideoPlayer(
controller: _videoController,
sliderVis: ButtonVis.alwaysOff,
variableVolume: false,
iconColor: Colors.white,
semantics: "Empathetic logo animation",
)
: SizedBox.shrink(),
),
);
}
Options #
semantics: Video's semantics label for screen readers. Required.iconColor: Color of the control buttons' icons. Required.controlsBackground:BoxDecorationfor the control section's background.controlsMainAxis&controlsCrossAxis: Alignment of control buttons.- Button visibility:
playVis,replayVis,volumeVis, andsliderVis- Options:
auto,alwaysOn, oralwaysOff showOnPause: Whether controls should show when the video is paused.
- Options:
autoPlay: Whether the video should start automatically.autoLoop: Whether the video should automatically restart when complete.startingVolume: Initial volume level.variableVolume: Whether a volume slider is present, or simply mute/un-mute.
Demo #
Checkout the example or see it...
Live #
Contributing #
Time #
Please reach out to the community contact about becoming a contributor.
Money #
Many thanks for any and all donations! We're happy to have helped!
Paypal #
Venmo #
Cash App #
Patreon #
Buy Me a Coffee #
Ko-fi #
License #
GNU GPLv3
Credits #
Flutter OSS #
efui_video_player wouldn't be as awesome as it is without these other awesome community projects...
And, of course, all the awesome Flutter (Google) devs.
