🙏 Highly inspired by flutter_youtube_view 🙏
This plugin provide a Youtube player for Android and iOS. We've encoutered problems using other flutter plugins : iOS integration doesn't work or take long time to load before playing videos.
This plugin using:
- Android (same library ! works well): https://github.com/PierfrancescoSoffritti/android-youtube-player
- iOS: https://github.com/youtube/youtube-ios-player-helper
- Add to your
pubspec.yaml
file:
youtuyer:
git:
url: git://github.com/guyaristide/youtuyer.git
- Import in dart code
import 'package:youtuyer/youtuyer.dart';
Currently apps need to opt-in for the UIViews embedding preview on iOS by adding a boolean property to the Info.plist (key=io.flutter.embedded_views_preview value=YES).
- Using Youtuyer
Container(
child: YoutuyerWidget(
onViewCreated: _onYoutubeCreated,
listener: this,
params: YoutubeParam(
videoId: 'gcj2RUWQZ60', showUI: true, startSeconds: 5 * 60.0),
),
)
- play()
- pause()
- loadOrCueVideo()
- seekTo()
- setVolume() only Android
- mute()
- unMute()
void onReady();
void onStateChange(String state);
void onError(String error);
void onVideoDuration(double duration);
void onCurrentSecond(double second);