all_in_one_video_player 1.0.0
all_in_one_video_player: ^1.0.0 copied to clipboard
A Flutter video player that supports YouTube, Vimeo, and server links with custom controls.
all_in_one_video_player #
A Flutter package providing an all-in-one video player widget that supports:
- βΆοΈ YouTube (via WebView)
- π Vimeo (via WebView)
- π Server-hosted videos (MP4/HLS) using
video_player
All-In-One Video Player π #
A high-performance, premium Flutter video player that seamlessly supports YouTube, Vimeo, and Direct Server Links (MP4, MKV, etc.) with a single unified controller.
β¨ Features #
- π± Multi-Source Support: Play YouTube, Vimeo, and server URLs (MP4/HLS) using the same widget.
- π¨ Premium UI: Modern, glassmorphism-inspired controls with smooth animations.
- β‘ Gestures: Double tap to seek (10s), Swipe for volume/brightness (coming soon).
- βοΈ Playback Speed: Control speed from 0.5x to 2.0x.
- π Looping: Easy toggle for continuous playback.
- πΌοΈ Thumbnail Support: Show a custom thumbnail while loading.
- π οΈ Fully Customizable: Use
PlayerThemeto match your app's branding. - πΊ Fullscreen: Intelligent orientation handling for an immersive experience.
π Getting Started #
Add the package to your pubspec.yaml:
dependencies:
all_in_one_video_player: ^1.0.0
Android Setup #
Ensure your minSdkVersion is 21 or higher in android/app/build.gradle.
iOS Setup #
Add the following to your ios/Runner/Info.plist:
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
</dict>
Hereβs the updated README.md Step 3 section, with the fix added for YouTube short links:
β Step 3: Use in UI #
Supports YouTube short URLs like:
https://youtu.be/
Example usage:
final youtubeController = PlayerController(
videoUrl: 'https://youtu.be/aPCl90cpdDo',
sourceType: VideoSourceType.youtube,
);
Full UI Example with Buttons #
class VideoPlayerDemoPage extends StatefulWidget {
const VideoPlayerDemoPage({Key? key}) : super(key: key);
@override
State<VideoPlayerDemoPage> createState() => _VideoPlayerDemoPageState();
}
class _VideoPlayerDemoPageState extends State<VideoPlayerDemoPage> {
final _youtube = PlayerController(
videoUrl: 'https://youtu.be/aPCl90cpdDo?si=_xKtFJyqqgH1S9dU',
sourceType: VideoSourceType.youtube,
);
final _vimeo = PlayerController(
videoUrl: 'https://vimeo.com/264560738',
sourceType: VideoSourceType.vimeo,
);
final _server = PlayerController(
videoUrl: 'http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4',
sourceType: VideoSourceType.server,
);
late PlayerController _current;
bool _isFullScreen = false;
@override
void initState() {
super.initState();
_current = _youtube;
}
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: _isFullScreen ? null : AppBar(title: const Text('All-in-One Player')),
body: Column(
children: [
AspectRatio(
aspectRatio: 16 / 9,
child: PlayerWidget(
controller: _current,
onFullScreenToggle: (value) => setState(() => _isFullScreen = value),
),
),
if (!_isFullScreen)
Row(
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: [
ElevatedButton(onPressed: () => setState(() => _current = _youtube), child: const Text("YouTube")),
ElevatedButton(onPressed: () => setState(() => _current = _vimeo), child: const Text("Vimeo")),
ElevatedButton(onPressed: () => setState(() => _current = _server), child: const Text("Server")),
],
),
],
),
);
}
}
β οΈ Notes #
- πΊ Some YouTube/Vimeo videos may be blocked from embedding due to licensing or content settings.
- π Web support is not included (this is Android/iOS only).
- π± On Android, hybrid composition is used for WebView.
π¨βπ» Author #
Md. Rahul Reza π rahulreza.com π¬ contact@rahulreza.com