Changelog History
-
v10.0.5 Changes
October 13, 2019- โ Added functions to mute/un-mute the player, thanks to @lucasvanhalst. See #446.
-
v10.0.4 Changes
August 25, 2019 -
v10.0.3 Changes
March 30, 2019- ๐ Fixes #334
-
v10.0.2 Changes
March 24, 2019- solves bug reported in issue #326.
-
v10.0.1 Changes
February 18, 2019- โ Adds support for video captions, thanks to @ct7ct7ct7. To know more read the documentation.
- ๐ Fixes branding issues in sample apps.
-
v10.0.0 Changes
February 11, 2019โฌ๏ธ 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!
YouTubePlayerInitListener
is a thing of the past, it has been removed from the code base. You can now directly add aYouTubePlayerListener
toYouTubePlayerView
. - ๐ป 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:
- ๐
YouTubePlayerInitListener
has been removed. - Every method of
YouTubePlayerListener
now takes aYouTubePlayer
as first argument. - ๐ Useless parameters have been removed from
IFramePlayerOptions
, such asautoplay
,origin
,showInfo
andmodestBranding
. They are deprecated on the IFrame player or not working on mobile devices. - ๐ The class
androidyoutubeplayer.utils.Callable
has been removed. - ๐ The method
setYouTubePlayerMenu
has been removed fromPlayerUIController
. - ๐ฆ The content of the
core
module is now under acore
package.
๐ New features:
- ๐
YouTubePlayerView
supports xml attributes, check out the documentation to learn more. - 0๏ธโฃ It is possible to let
YouTubePlayerView
initialize itself by using the attributeenableAutomaticInitialization
, which isture
by 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
YouTubePlayerSeekBar
andFadeViewHelper
, 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.
YouTubePlayerView
has a newgetYouTubePlayerWhenReady
method.- ๐ The utility
cueOrLoadVideo
has been added, read the documentation to know more. PlayerUIController
now has a fluent interfaceYouTubePlayerMenu
now has a fluent interface- The dependencies of both the
core
andchromecast-sender
modules 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:
-
v9.0.1 Changes
December 10, 2018Bug fixes
- ๐ Fixed a bug caused the
onInitSuccess
callback to be called outside the main thread.
- ๐ Fixed a bug caused the
-
v9.0.0 Changes
November 12, 2018Breaking changes
โก๏ธ The library is now using Androidx instead of the old support libraries. You may have some problems with the new update if you're using the support library Lifecycle classes. The best way to solve this issue is to migrate your app to Androidx.[core] New features
IFramePlayerOptions : it is now possible to set some of the IFrame Player parameters from Java/Kotlin, previously this was possible only through Javascript. This opens new customization possibilities, for example it's possible to disable the Android UI of the player and enable the Web UI instead.To read more about this feature refer to the doc.
Thanks to @matthewrkula for implementing this feature.
๐ [core] Bug Fixes
- Background playback is working again, read the doc to learn how to enable it. Thanks to @CajetanP for the bug fix.
- Solved a bug that was hiding custom actions if they were enabled before playing a video.
[core] Sample app
- โ Added Fragment sample app.
- โ Added IFramePlayerOptions sample app.
-
v8.0.1 Changes
June 30, 2018โก๏ธ This is the biggest update this library ever had. When I first created the library I didn't intend for it to become a long term project and I lacked the experience to set it up properly. Version 8 fixes most of the bad decisions I made and is supposed to set this project up for success in the long term.
Along with these changes a big new feature is now available: Chromecast playback.โก๏ธ If you are updating from an older version you will have to make some changes in your project, mostly renaming packages and some classes.
โก๏ธ At the end of this post you can find a simple "guide" for updating from version 7 to 8.
Readme file
๐ The readme of the project has been changed heavily, from now on it will contain the documentation of the library.Gradle dependency
From version 0 to 7 the Gradle dependency of this library has been served through Jitpack. It is now on jCenter instead.The YouTube player library is now published under the name core. The Chromecast extension library is published under the name chromecase-sender.
dependencies { implementation 'com.pierfrancescosoffritti.androidyoutubeplayer:core:8.0.1' } dependencies { implementation 'com.pierfrancescosoffritti.androidyoutubeplayer:core:8.0.1' implementation 'com.pierfrancescosoffritti.androidyoutubeplayer:chromecast-sender:0.15' implementation 'org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.2.50' }
๐ New Features
- Chromecast playback. A new module has been added to the project: chromecast-sender. This is an extension library that you can use to cast YouTube videos to a Google Cast enabled devices directly from your app.
A Chromecast receiver is also provided.
๐ Read the documentation for more information.
Try the sample app here. An example is also available in the core sample app.
๐ฅ Breaking changes
- ๐ Changed package name of the whole library. It now is
com.pierfrancescosoffritti.androidyoutubeplayer
. To be consistent with the actual name of the library. - Listeners interfaces have been moved in a listeners package.
PlayerUIController.setCustomFullScreenButtonListener
has been renamed toPlayerUIController.setFullScreenButtonListener
YouTubePlayerStateTracker
as been renamed toYouTubePlayerTracker
.YouTubePlayerTracker.getCurrentState()
renamed toYouTubePlayerTracker.getState()
.- Player constants are now enums.
Minor improvements
- ๐ improved Kotlin compatibility.
๐ Bug fixes
- The WebView hosting the player is now detached before is destroyed.
Migrating from version 7 to 8
- ๐ Change the Gradle dependency from
implementation 'com.github.PierfrancescoSoffritti:AndroidYouTubePlayer:6.0.0'
toimplementation 'com.pierfrancescosoffritti.androidyoutubeplayer:core:8.0.1'
. You can also removemaven { url "https://jitpack.io" }
from your project-level build.gradle file. - โ Remove all the imports from your classes, use the IDE to re-import classes from the library from the correct package name.
- โก๏ธ Remember to manually update the package of the Views in your XML files. The IDE may miss them.
- ๐ฅ Apply the changes in the name I have reported under Breaking changes.
- Convert player constants to enums.
- Chromecast playback. A new module has been added to the project: chromecast-sender. This is an extension library that you can use to cast YouTube videos to a Google Cast enabled devices directly from your app.
-
v7.0.1 Changes
June 14, 2018๐ Changes:
- Solved issue #145, when opening a YouTube video by clicking the YouTube button on the player, the video will start playing from where it was stopped.
- Solved issue #144, it's not possibile to add null
YouTubePlayerListener
s toYouTubePlayer
. - ๐ Improved compatibility with Kotlin.
- ๐ Improved documentation.
- ๐ Improved sample app.