flutter_youtube_view
Flutter के लिए YouTube विजेट
- स्टार
- 65
- फ़ोर्क
- 44
- अंतिम पुश (UTC)
- 15 फ़र॰ 2024
- प्रोजेक्ट स्थिति
- सक्रिय
मूल README
यह अंग्रेज़ी मूल स्नैपशॉट है। नवीनतम सामग्री GitHub पर देखें।
flutter_youtube_view
This plugin provides Inlining YouTube player. To interact with YouTube the library uses the Frame Player API, inside of a WebView (Android), WKWebview (iOS). Therefore the YouTube app is not required on the user's device and there are no issues with YouTube Terms of Service.
This plugin using:
- Android: https://github.com/PierfrancescoSoffritti/android-youtube-player
- iOS: https://github.com/rinov/YoutubeKit
APK sample: https://github.com/hoanglm4/flutter_youtube_view/tree/master/example/android/APK
How to Use
1. Depend
Add this to you package's pubspec.yaml file:
dependencies:
flutter_youtube_view: ^2.0.4
2. Install
Run command:
$ flutter packages get
3. Import
Import in Dart code:
import 'package:flutter_youtube_view/flutter_youtube_view.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).
4. Using Youtube View
Container(
child: FlutterYoutubeView(
onViewCreated: _onYoutubeCreated,
listener: this,
scaleMode: YoutubeScaleMode.none, // <option> fitWidth, fitHeight
params: YoutubeParam(
videoId: 'gcj2RUWQZ60',
showUI: false,
startSeconds: 0.0, // <option>
autoPlay: false) // <option>
)
),
Features
Call IFrame API during playback
- play()
- pause()
- loadOrCueVideo()
- seekTo()
- setVolume() only Android
- mute()
- unMute()
- setPlaybackRate(rate: PlaybackRate.RATE_1) or setPlaybackRate(rateValue: 1.0)
PLAYER callback
void onReady();
void onStateChange(String state); // UNKNOWN, UNSTARTED, ENDED, PLAYING, PAUSED, BUFFERING, VIDEO_CUED
void onError(String error); // INVALID_PARAMETER_IN_REQUEST, HTML_5_PLAYER, VIDEO_NOT_FOUND, VIDEO_NOT_PLAYABLE_IN_EMBEDDED_PLAYER
void onVideoDuration(double duration);
void onCurrentSecond(double second);
उपयोग की गई निर्भरताएँ
निर्भरता सूची 1 आइटम
- flutter
{"sdk":"flutter"}
अपने प्रोजेक्ट के लिए रिपॉज़िटरी कैसे चुनें?
उपयोग के अनुसार छाँटें, गतिविधि की तुलना करें और अपनाने से पहले मूल प्रोजेक्ट की आवश्यकताएँ जाँचें।
- नाम, लेखक या विवरण से खोजें और तकनीकी विषय से परिणाम सीमित करें।
- स्टार, फ़ोर्क और हाल के पुश की तुलना करें। स्टार रुचि दर्शाते हैं, गुणवत्ता की गारंटी नहीं।
- उपयोग से पहले GitHub पर README, लाइसेंस और Issues जाँचें।
स्रोत और रखरखाव
“A repository is the most basic element of GitHub.”
GitHub Docs — About repositories ↗