y_player 2.1.0
y_player: ^2.1.0 copied to clipboard
YPlayer is a Flutter package that provides an easy-to-use YouTube video player widget
Changelog #
2.1.0 #
Fixed #
- Playback failing on every video. Released 2.0.6 requested stream manifests
with the
iosthentvclients, a combination YouTube now rejects outright withVideoUnplayableException/ "does not contain any playable streams". Extraction now asksandroidVr,androidSdklessandiosin a singlegetManifestcall — which merges and 403-checks the streams from all of them — and falls back totv,mediaConnectandsafarifor age or region restricted videos (#25, #26, #19, #24). - Separate audio streams were attached through
Media.extras, which is user metadata that never reaches libmpv, so the DASH path could play video with no sound. Audio is now attached withPlayer.setAudioTrack. - The quality and speed sheets did not open in fullscreen and silently piled up
behind it, so they all appeared at once on returning to portrait. The buttons
now resolve their own
BuildContextinstead of closing over the inline one. chooseBestQualitynever actually applied: it assigned_currentQualitybefore callingsetQuality, whose first guard is_currentQuality == height, making the call a silent no-op.- The manifest LRU cache was written but never read, so every initialization refetched while the cache grew to its 20 entry ceiling.
getAvailableQualities()sorted a copy returned bysublistand threw the result away, leaving qualities unsorted.- The controller never cancelled its player stream subscriptions and never
disposed
statusNotifier. Subscriptions are now cancelled before the player is disposed, anddispose()is idempotent.
Added #
seek(Duration),seekForward(),seekBackward()andsetVolume()onYPlayerController;seekclamps to the video duration (#16).YPlayer.showThumbnail(defaulttrue) displays the video's YouTube thumbnail while it loads, with an automaticmaxresdefault→hqdefaultfallback. Also exposed asYPlayerController.thumbnailUrland the staticYPlayerController.thumbnailUrlFor()(#18).YPlayer.fitto control how the video is inscribed into the player box (defaults toBoxFit.contain, the previous behaviour) (#22).YPlayerController.errorMessageexposes why initialization failed instead of leaving callers with a bareYPlayerStatus.error.tool/verify_extraction.dart, a manual script that checks the client fallback chain against live YouTube.
Changed #
- On desktop the player now prefers H.264 renditions at a given resolution. YouTube serves 1080p+ mostly as VP9/AV1, which many GPUs cannot decode in hardware, so libmpv fell back to software decoding and the picture stuttered while audio stayed fine (#23).
- A muxed rendition is preferred on
Auto, avoiding the cost of muxing two network streams locally. - Malformed URLs now report themselves at initialization rather than surfacing
later as
Null check operator used on a null valueortype 'Null' is not a subtype of type 'Uri'. youtube_explode_dartraised to^3.1.0, which introduces theandroidSdkless,mediaConnectandsafariclients the fallback chain uses.
2.0.6 #
- Dependencies updated
- Minor bug fixes
- Added
forceOriginalAudioparameter to default play of original audio instead of auto-dubbed audio. Thanks for the @ioridev for the contribution. - New contributors
2.0.5+1 #
- Dependencies updated
2.0.5 #
- Video quality selection feature added. Thanks to @MostafaAlyy for the contribution
2.0.4+1 #
- Playback speed UI changed.
2.0.4 #
- Explode version updated.
- Support for Flutter 3.27.x
2.0.3 #
- Bottom button bar and seekbar margin customization added.
2.0.2 #
- Playback speed controller added
2.0.1 #
- Fixed bug fullscreen mode not working properly
- Added additional controls to Fullscreen mode
2.0.0 #
- Major refactoring to address YouTube's deprecation of muxed streams
- Implemented separate handling of video and audio streams for better quality options
- Introduced
YPlayerInitializerfor proper initialization of dependencies - Changed default controls to
MaterialVideoControls - Added
colorproperty for customizing control colors - Improved performance and stability
- Enhanced error handling and logging
- Updated documentation and migration guide
- Breaking Changes:
- Initialization process now requires calling
YPlayerInitializer.ensureInitialized() - Some properties in
YPlayerconstructor have changed or been removed ChewieControlleris no longer used; all controls now useYPlayerController
- Initialization process now requires calling
1.1.0 #
- Introduced new controller-based functionality for improved state management
- Enhanced handling of app lifecycle changes and fullscreen mode
- Added
onControllerReadycallback toYPlayerwidget - Improved error handling and recovery
- Deprecated
getController()method in favor ofonControllerReadycallback - Added
isInitializedproperty toYPlayerController - Improved documentation and usage examples
[Earlier versions...]