adaptive_video_player 1.1.0
adaptive_video_player: ^1.1.0 copied to clipboard
A Flutter video player package that seamlessly handles both YouTube videos and direct video URLs with adaptive player selection. Supports Android, iOS, Windows, and Web.
Adaptive Video Player ๐ฅ #
๐ฅ One Widget. All Platforms. YouTube + MP4. Zero Headaches.
A powerful cross-platform Flutter video player that supports YouTube, MP4, HLS, and local videos with one unified widget.
Android ยท iOS ยท Windows ยท macOS ยท Linux ยท Web
Quick Start โก #
AdaptiveVideoPlayer(
config: VideoConfig(
videoUrl: "https://youtu.be/VIDEO_ID",
),
);
Just drop it in โ it automatically adapts to YouTube or direct video streams.
Screenshots ๐ธ #
| Android | Windows | Web |
|---|---|---|
| [Android] | [Windows] | [Web] |
Features โจ #
Adaptive Video Player ๐ฌ #
- ๐ Smart YouTube vs MP4 detection
- ๐ฏ Unified API (one widget for everything)
- ๐ True Cross-Platform support
- ๐ Native analytics events & callbacks (
onAnalyticsEvent) - ๐ง Production-ready architecture
YouTube Support ๐บ #
- Native-like mobile experience
- Native YouTube controls on Desktop & Web
- Live Stream support (
isLive,viewerCount) - Force Desktop Mode on mobile
- Settings panel (HD, captions, loop, mute)
- Safe external link handling
- Fullscreen with state preservation
- WASM ready (Web via
package:web)
Direct Video Support ๐๏ธ #
- MP4 ยท MOV ยท MKV ยท WebM ยท HLS ยท Local files
- Quality selection
- Subtitle support (SRT/VTT)
- Custom control builders
- Error handling
- Windows plugin integration
- Fully custom adaptive controls (No Chewie dependency)
Comparison With Popular Packages ๐ #
| Feature | adaptive_video_player | youtube_player_flutter | chewie | video_player |
|---|---|---|---|---|
| YouTube Support | โ | โ | โ | โ |
| MP4/HLS Support | โ | โ | โ | โ |
| Desktop Support | โ | โ | โ ๏ธ | โ ๏ธ |
| Unified Widget | โ | โ | โ | โ |
| Live Stream | โ | โ | โ | โ |
Platform Behavior ๐ฅ #
| Platform | Engine |
|---|---|
| Android / iOS | youtube_player_flutter |
| Windows / macOS / Linux | InAppWebView + localhost |
| Web | HTML iframe via package:web |
Desktop uses
http://localhostto bypass YouTube iframe Error 153 restriction.
Installation ๐ฆ #
dependencies:
adaptive_video_player: ^1.1.0
Example Usage ๐ #
YouTube #
AdaptiveVideoPlayer(
config: VideoConfig(
videoUrl: 'https://www.youtube.com/watch?v=vM2dC8OCZoY',
),
);
Direct MP4 #
AdaptiveVideoPlayer(
config: VideoConfig(
videoUrl: 'https://example.com/video.mp4',
),
);
Live Stream #
AdaptiveVideoPlayer(
config: VideoConfig(
videoUrl: 'https://www.youtube.com/watch?v=LIVE_ID',
isLive: true,
viewerCount: "1.2K",
),
);
Roadmap (Planned) ๐ฎ #
- ๐ฌ Playlist Support (Coming Soon)
- ๐บ Picture-in-Picture (In Progress)
Author ๐จ๐ป #
Ahmed Mohamed Alam GitHub: https://github.com/ahmedalam782
License ๐ #
MIT License