youtube_video_webview 1.0.4
youtube_video_webview: ^1.0.4 copied to clipboard
A customizable YouTube video player for Flutter, supporting embedded playback, fullscreen mode, sharing, captions, and seamless redirection to YouTube inside a webview.
๐ฌ Youtube Video Webview for Flutter (Android & iOS) #
A customizable YouTube video player for Flutter, supporting embedded playback, fullscreen mode, sharing, captions, and seamless redirection to YouTube inside a webview.
โจ Features #
- ๐ Adjustable video height and width
- ๐ Redirects to the YouTube page inside a webview (via YouTube logo or video title)
- ๐ฅ๏ธ Fullscreen video playback
- ๐ Share videos with a custom message
- ๐ฌ Caption (subtitles) control
- โ๏ธ Settings button (YouTube native menu)
- ๐งญ Multiple AppBar options for the redirected webview
โ๏ธ Check out: Roadmap
๐ Getting Started #
Requirements #
- Flutter >= 1.17.0
๐ฆ Installation #
Add the package to your pubspec.yaml:
youtube_video_webview: ^1.0.0
Then run:
flutter pub get
๐งฉ Usage #
1๏ธโฃ Import the package #
import 'package:youtube_video_webview/youtube_video_webview.dart';
2๏ธโฃ Add the widget #
YoutubeVideoWebview(
videoId: '<VIDEO-ID>',
referrerHeader: '<APP-IDENTIFIER-WITH-HTTPS>',
externalBrowserSettings: YoutubePageWebViewSettings(
appBar: YoutubeVideoWebviewAppBarShare(
videoId: '<VIDEO-ID>',
shareText: 'Check out this video!',
),
),
)
๐ YouTube Page Webview Settings #
Customize how the YouTube page opens when redirected:
YoutubePageWebViewSettings(
dragToDismiss: true, // default
appBar: YoutubeVideoWebviewAppBarShare(
videoId: '<VIDEO-ID>',
shareText: 'Check out this video!',
),
)
โก๏ธ See App Bar Options
๐งญ App Bar Options #
๐น Default App Bar #
appBar: YoutubeVideoWebviewAppBarDefault()
๐น Share App Bar #
appBar: YoutubeVideoWebviewAppBarShare(
videoId: '<VIDEO-ID>',
shareText: 'Check out this video!',
)
๐น Custom App Bar #
appBar: YoutubeVideoWebviewAppBarCustom(
appBar: AppBar(
title: const Text('Custom App Bar'),
backgroundColor: Colors.green,
),
)
๐น No App Bar (Drag to Dismiss) #
dragToDismiss: true
โน๏ธ If no AppBar is provided, drag-to-dismiss is enabled automatically.
๐งช Additional Information #
This package is under active development, but it is already stable and ready for production use.
๐ง More features and improvements coming soon!
๐ค Contributing #
Found a bug or have an idea?
๐ Suggestions & Issues
๐ค Author #
๐ LinkedIn
๐ป GitHub