Aus öffentlichen Paketdaten erstellte Orientierung.
YPlayer ist ein Flutter-Paket, das die Integration von YouTube-Videos in Flutter-Anwendungen vereinfacht. Es bietet ein anpassbares Videoplayer-Widget, das entwickelt wurde, um YouTube-Inhalte nahtlos über mehrere Plattformen zu integrieren und abzuspielen. Mit minimalem Setup können Entwickler YouTube-Videos mithilfe von Video-IDs oder URLs anzeigen, wobei responsive Design und grundlegende Wiedergabesteuerungen unterstützt werden. Das Paket nutzt native YouTube-Player auf jeder Plattform für optimale Leistung und Kompatibilität.
Anwendungsfälle
YouTube-Videos in Apps einbetten
Erstellung von Bildungsinhaltsplayern
Medienreiche Flutter-Anwendungen erstellen
Integration von Videotutorials
Entwicklung von Streaming- oder Unterhaltungs-Apps
Hauptmerkmale
Einfaches Einbetten von Videos mit Video-ID oder URL
Unterstützung für Android, iOS, macOS, Windows und Linux
Reagierendes und anpassbares Player-UI
Eingebaute Wiedergabesteuerung
Native YouTube-Player-Integration
Geeignet für
Flutter-Entwickler, die Medien-Apps erstellen
Ersteller von Bildungs-Apps
Inhaltsplattformen mit Videobibliotheken
Apps, die YouTube-Videowiedergabe erfordern
Hinweise
Benötigt Internetverbindung zum Laden des Videos
Begrenzte Anpassungsmöglichkeiten außerhalb der grundlegenden Steuerungen
Abhängig von der Verfügbarkeit der YouTube-API
Für bestimmte Plattformen sind möglicherweise zusätzliche Berechtigungen erforderlich
Nicht geeignet für Offline-Videowiedergabe
Original-README
Originaler README-Schnappschuss aus dem verknüpften Quell-Repository. Aktuelle Inhalte finden Sie im Repository.
YPlayer
YPlayer is a Flutter package that provides an easy-to-use YouTube video player widget. It leverages the power of the youtube_explode_dart package for fetching video information.
Features
Play YouTube videos directly in your Flutter app
Support for fullscreen mode
Optional autoplay
Video Quality selection
Playback speed control
Customizable loading and error widgets
Easy to use API with play, pause, and stop functionality
Callback support for player state changes and progress updates
Customizable progress bar colors
Improved handling of app lifecycle changes and fullscreen mode
Enhanced error handling and recovery
Separate handling of video and audio streams for better quality
Installation
Add y_player to your pubspec.yaml file:
dependencies:y_player:^2.0.0
Then run:
flutter pub get
Usage
First, ensure that you initialize the YPlayer in your main.dart:
Version 2.0.0 introduces significant changes to address the deprecation of muxed streams in YouTube and to improve overall performance. Here are the key changes:
To migrate your existing code:
Update your pubspec.yaml to use version 2.0.0 or later of y_player.
Update your YPlayer widget usage. The basic usage remains the same, but some properties have changed:
YPlayer(
youtubeUrl: 'https://www.youtube.com/watch?v=dQw4w9WgXcQ',
color: Colors.red, // New property for customizing controls color// materialProgressColors and cupertinoProgressColors are no longer available
)
If you were using ChewieController directly, you'll need to update to use YPlayerController instead.
These changes address the deprecation of muxed streams in YouTube and provide a more robust and efficient video playback experience. The separate handling of video and audio streams allows for better quality options and more flexibility in playback.