This is a major update, upgrading from an older version will break backward compatibility.
The code base has been rewritten in Kotlin and major improvements have been implemented throughout the library.
Most notably, now YouTubePlayerView:
- Supports custom attributes, to configure it directly from XML. It is now possible to play a video without writing a single line of Java/Kotlin code. For more advanced use cases everything can also be done programmatically, as before.
- Can manage its initialization internally!
YouTubePlayerInitListeneris a thing of the past, it has been removed from the code base. You can now directly add aYouTubePlayerListenertoYouTubePlayerView. - Can be easily used with the web-based UI instead of the native UI. When using the web-based UI it will be possible to click the "share" and "watch later" buttons that YouTube recently forced to be always visible.
The documentation has been greatly improved, please use it and feel free to contribute :)
Follows a detailed description of the changes.
Breaking changes:
YouTubePlayerInitListenerhas been removed.- Every method of
YouTubePlayerListenernow takes aYouTubePlayeras first argument. - Useless parameters have been removed from
IFramePlayerOptions, such asautoplay,origin,showInfoandmodestBranding. They are deprecated on the IFrame player or not working on mobile devices. - The class
androidyoutubeplayer.utils.Callablehas been removed. - The method
setYouTubePlayerMenuhas been removed fromPlayerUIController. - The content of the
coremodule is now under acorepackage.
New features:
YouTubePlayerViewsupports xml attributes, check out the documentation to learn more.- It is possible to let
YouTubePlayerViewinitialize itself by using the attributeenableAutomaticInitialization, which istureby default. - It is now possible to easily replace the native UI of the player with the web-based UI. This makes it possible to click the "share" and "watch later" buttons.
- A set of components are now available to help you build custom UIs, such as
YouTubePlayerSeekBarandFadeViewHelper, read the documentation to know more.
Improvements:
- The core module has been rewritten in Kotlin. This doesn't break its compatibility with Java, it just improves the code base.
YouTubePlayerViewhas a newgetYouTubePlayerWhenReadymethod.- The utility
cueOrLoadVideohas been added, read the documentation to know more. PlayerUIControllernow has a fluent interfaceYouTubePlayerMenunow has a fluent interface- The dependencies of both the
coreandchromecast-sendermodules have been reorganized in order to import only what's needed. - Private resources of the library have been renamed with the "ayt_" prefix.
- The sample apps have been reorganized and improved with new examples.
- Both sample apps are now built on top of library-sample-app-template.
Bugfixes: