All-in-one Flutter video player โ stream from YouTube, Vimeo, network, assets files
Introduction
omni_video_player is a Flutter video player built on top of Flutterโs official video_player
plugin.
It supports YouTube (via youtube_explode_dart
with an automatic WebView-based fallback implemented using webview_flutter
to handle cases where YouTube rate-limits requests, temporarily blocking direct extraction โ see issue #323),
Vimeo videos (now using webview_flutter
for improved stability and maintainability),
as well as network and asset videos.
A single unified controller is provided to manage playback across all supported video types seamlessly.
๐จ Highly customizable โ tweak UI, show/hide controls, and easily integrate your own widgets. ๐ฎ The controller gives full control over video state and callbacks for smooth video management on mobile and web.
๐ฏ Long-term goal: to create a universal, flexible, and feature-rich video player that works flawlessly across all platforms and video sources, using the most robust and actively maintained technologies to ensure consistent behavior over time.
Supported Platforms & Status
Video Source Type | Android | iOS | Web | Status |
---|---|---|---|---|
YouTube | โ | โ | โ | โ
Supported โ uses youtube_explode_dart by default on mobile, and WebView (webview_flutter ) on web or as fallback on mobile to bypass temporary rate-limit blocks |
Vimeo | โ | โ | โ | โ
Supported โ uses webview_flutter |
Network | โ | โ | โ | โ Supported |
Asset | โ | โ | โ | โ Supported |
File | โ | โ | โ | โ Supported |
Twitch | - | - | - | ๐ Planned |
TikTok | - | - | - | ๐ Planned |
Dailymotion | - | - | - | ๐ Planned |
โจ Features
-
โ Play videos from:
- YouTube (live and regular videos, with automatic WebView fallback powered by
webview_flutter
to keep playback working even under temporary YouTube rate-limit restrictions) - Vimeo (public โ now using official
webview_flutter
for stable playback) - Network video URLs
- Flutter app assets
- File from device
- YouTube (live and regular videos, with automatic WebView fallback powered by
-
๐ Customizable player UI (controls, theme, overlays, labels)
-
๐ Autoplay, replay, mute/unmute, volume control
-
โช Seek bar & scrubbing
-
๐ผ Thumbnail support (custom or auto-generated for YouTube and Vimeo)
-
๐ Global playback & mute sync across players
-
โถ Fullscreen player
-
โ๏ธ Custom error and loading widgets
-
โฑ Playback Speed
-
๐๏ธ Quality selection UI:
- Supports YouTube quality switching
- Supports HLS/network stream quality switching
๐งช Demo
๐ Getting Started
Installation
dependencies:
omni_video_player: <latest_version>
๐ ๏ธ Android Setup
In your Flutter project, open:
android/app/src/main/AndroidManifest.xml
<!-- Add inside <manifest> -->
<uses-permission android:name="android.permission.INTERNET"/>
<!-- Add inside <application> -->
<application
android:usesCleartextTraffic="true"
... >
</application>
โ
The INTERNET
permission is required for streaming videos.
โ ๏ธ The usesCleartextTraffic="true"
is only needed if you're using HTTP (not HTTPS) URLs.
๐ iOS Setup
To allow video streaming over HTTP (especially for development or non-HTTPS sources), add the following to your Info.plist
file:
<!-- ios/Runner/Info.plist -->
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
</dict>
๐ฆ Usage Examples
Network
VideoSourceConfiguration.network(
videoUrl: Uri.parse('https://example.com/video.mp4'),
);
YouTube
VideoSourceConfiguration.youtube(
videoUrl: Uri.parse('https://youtu.be/xyz'),
preferredQualities: [OmniVideoQuality.high720, OmniVideoQuality.low144],
);
Vimeo
VideoSourceConfiguration.vimeo(
videoId: '123456789',
preferredQualities: [OmniVideoQuality.high720],
);
Asset
VideoSourceConfiguration.asset(
videoDataSource: 'assets/video.mp4'),
);
๐ฑ Example App
Explore the example/
folder for working demos:
- Full demo using different video sources:
main.dart
- Minimal setup with controller and play/pause logic:
example.dart
๐ก Great starting points to understand how to integrate and customize the player.
๐ฏ Sync UI with AnimatedBuilder
When using OmniPlaybackController
, the controller itself is a Listenable
, meaning it notifies listeners when playback state changes (e.g. play, pause, fullscreen).
To build dynamic UI that reacts to those changes (like updating a play/pause button), wrap your widgets with AnimatedBuilder
:
OmniVideoPlayer(
options: VideoPlayerConfiguration.youtube(
videoUrl: Uri.parse('https://www.youtube.com/watch?v=cuqZPx0H7a0'),
),
callbacks: VideoPlayerCallbacks(
onControllerCreated: (controller) {
_controller = controller;
setState(() {}); // Enables the button below
},
),
),
AnimatedBuilder(
animation: Listenable.merge([controller]),
builder: (context, _) {
if (controller == null) return const CircularProgressIndicator();
final isPlaying = controller.isPlaying;
return ElevatedButton.icon(
onPressed: () =>
isPlaying ? controller.pause() : controller.play(),
icon: Icon(isPlaying ? Icons.pause : Icons.play_arrow),
label: Text(isPlaying ? 'Pause' : 'Play'),
);
},
);
โ Why it's needed
Flutter widgets donโt rebuild on Listenable
changes by default. AnimatedBuilder
lets your UI stay in sync without manually calling setState()
on every controller update โ making your code more efficient and reactive.
โน๏ธ Recommended for any UI that depends on the controller (playback state, fullscreen, etc.). It ensures consistent behavior and avoids state mismatch.
๐ฎ Future Developments
Feature | Description | Implemented |
---|---|---|
๐ Playlist Support | YouTube playlist playback and custom video URL lists | โ |
โฉ Double Tap Seek | Skip forward/backward by configurable duration | โ |
๐ Side Command Bars | Left and right customizable sidebars for placing user-defined widgets or controls | โ |
๐งญ Header Bar | Custom header with title, channel info, and actions | โ |
๐ผ Picture-in-Picture (PiP) | Play video in floating overlay while multitasking | โ |
๐ถ Quality Selection | Switch between 360p, 720p, 1080p, etc. during playback | โ (YouTube, Network HLS) |
โฑ Playback Speed Control | Adjust speed: 0.5x, 1.5x, 2x, etc. | โ |
๐ Looping / Repeat | Loop a single video or an entire playlist | โ |
โฟ Accessibility | Screen reader support, keyboard nav, captions, ARIA, high contrast, etc. | โ |
โฌ๏ธ Download / Offline Mode | Save videos temporarily for offline playback | โ |
๐บ Chromecast & AirPlay | Stream to external devices like TVs or smart displays | โ |
๐ Parental Controls | Restrict age-inappropriate or sensitive content | โ |
โ๏ธ Settings Button | Easily access and configure playback preferences | โ |
๐ Swipe to Exit Fullscreen | Swipe down (or specific gesture) to exit fullscreen mode | โ |
๐ License
BSD 3-Clause License โ see LICENSE
Libraries
- omni_video_player
- omni_video_player/controllers/global_playback_controller
- omni_video_player/controllers/omni_playback_controller
- omni_video_player/models/custom_overlay_layer
- omni_video_player/models/custom_player_widgets
- omni_video_player/models/global_playback_control_settings
- omni_video_player/models/omni_video_quality
- omni_video_player/models/player_ui_visibility_options
- omni_video_player/models/video_player_callbacks
- omni_video_player/models/video_player_configuration
- omni_video_player/models/video_source_configuration
- omni_video_player/models/video_source_type
- omni_video_player/theme/omni_video_player_theme
- omni_video_player/widgets/omni_video_player