Flick Video Player 是一个基于原生 video_player 插件构建的 Flutter 高级视频播放包。它提供了一个易于使用且可自定义的界面,具备播放/暂停控制、进度跟踪、全屏支持和手势处理等功能。该包旨在简化 Flutter 应用中的视频集成,抽象了底层复杂性,同时为开发者提供了灵活性。该包支持 Android、iOS 和 macOS 平台,非常适合跨平台视频应用。
适合场景
在移动应用中流式传输视频内容
向教育或娱乐应用添加视频播放功能
集成视频教程或演示
构建媒体播放器界面
创建视频丰富的社交媒体功能
主要特点
预构建的 UI 组件
基于手势的控制
全屏模式支持
可自定义主题
跨平台兼容性
流畅的播放性能
适合对象
Flutter 开发人员构建媒体应用
需要简单视频播放的应用
需要响应式视频UI的项目
寻求快速视频集成的开发者
注重跨平台一致性的团队
使用建议
需要 video_player 作为依赖项
超出所提供小部件的定制功能有限
可能需要额外的样式来处理复杂的用户界面
依赖于平台特定的视频编解码器
不适合高级视频编辑功能
原始 README
以下为关联源码仓库的 README 原文快照,最新内容请访问源码仓库。
Flick Video Player
Flick Video Player is a video player for flutter.
The video_player plugin gives low level access for the video playback. Flick Player wraps video_player under the hood and provides base architecture for developers to create their own set of UI and functionalities.
Features
Double tap to seek video.
On video tap play/pause, mute/unmute, or perform any action on video.
Main entry point, takes a FlickManager and a widget flickVideoWithControls as one of the arguments.
FlickManager
Manages all the video related operations with the help of different managers. FlickVideoManager is responsible to maintain life-cycle of a video, change a video and listen to state changes on the video. FlickControlManager is responsible to perform action on the video such as play, mute, seek, toggle full-screen etc. FlickDisplayManager is responsible to show/hide controls when player state changes.
FlickVideoWithControls
A helper widget to render video_player using FlickNativeVideoPlayer and Custom player controls. To create video player with custom controls you have to use this widget and pass this to FlickVideoPlayer in the argument flickVideoWithControls. closedCaptionTextStyle argument added to style video subtitles.
FlickPlayToggle
A UI helper widget to create play/pause/replay button for the video player. You can either pass your custom play, pause and replay widgets or change settings for the default icons.
FlickSoundToggle
A UI helper widget to create mute/unmute button for the video player. You can either pass your custom mute and unmute widgets or change settings for the default icons.
FlickFullscreenToggle
A UI helper widget to create fullscreen/fullscreen_exit button for the video player. You can either pass your custom fullscreen and fullscreen_exit widgets or change settings for the default icons.
FlickVideoProgressBar
A UI helper widget to create progress bar for your video player. It takes FlickProgressBarSettings as one of the arguments so that user can create a custom progress bar. This is highly customizable, user can almost change all the properties of the progress bar like height, handleRadius, provide custom Color or custom Paint.
FlickTotalDuration
A text UI helper widget to show total duration of the video.
FlickCurrentPosition
A text UI helper widget to show current position of the video.
FlickLeftDuration
A text UI helper widget to show left duration of the video.
FlickSetPlayBack
A text UI helper widget to change the playback speed of the video.
FlickVideoBuffer
A UI helper widget to show CircularProgressIndicator or your custom widget when the video is buffering.
FlickAutoPlayCircularProgress
A UI helper widget to show circular progress bar with timer to switch to the next video.
FlickSeekVideoAction
An Action helper to seek video forward/backward by custom Duration on double tap of screen. Takes child as one of the arguments to nest other actions or widgets.
FlickShowControlsAction
An Action helper to toggle between show/hide of controls on tap of the screen. Takes child as one of the arguments to nest other actions or widgets.
FlickTogglePlayAction
An action helper to toggle between play/pause on tap of the screen. Takes child as one of the arguments to nest other actions or widgets.
FlickToggleSoundAction
An action helper to toggle between mute/unmute on tap of the screen. Takes child as one of the arguments to nest other actions or widgets.
FlickSubtitleToggle
An action helper to toggle between display subtitle/no-subtitle on tap of the screen. Takes child as one of the arguments to nest other actions or widgets.
To play a list of videos you have to create your custom DataManager, You can find some of the implementations in /example folder.
UI Helper and Action helpers are widgets which interacts with FlickDisplayManager, FlickControlManager and FlickVideoManager you can easily create your custom widgets/actions, Provider package is used for state management.
Web
Guideline for web: As we are using video_player_web under-hood please follow video_player_web doc before you start.
Default shortcuts
Key
Behavior
f
Toggle full-screen
m
Toggle mute
ArrowRight
Seek forward
ArrowLeft
Seek backward
(Space character)
Toggle play
ArrowUp
Increase volume
ArrowDown
Decrease volume
You can pass webKeyDownHandler argument to FlickVideoPlayer and manage the keyboard shortcuts yourself.
Notes
Esc shortcut to exit from full-screen is in development.
Origin of third party content
Videos
9th May & Fireworks - https://mazwai.com/video/9th-May-&-Fireworks/455089
Iceland | Land of Fire and Ice - https://mazwai.com/video/iceland-%7C-land-of-fire-and-ice/455108
Rio from Above - https://mazwai.com/video/rio-from-above/455099
The Valley - https://mazwai.com/video/the-valley/455101