android-youtube-player v8.0.1 Release Notes

Release Date: 2018-06-30 // almost 6 years ago
  • ⚡️ 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 to PlayerUIController.setFullScreenButtonListener
    • YouTubePlayerStateTracker as been renamed to YouTubePlayerTracker.
    • YouTubePlayerTracker.getCurrentState() renamed to YouTubePlayerTracker.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' to implementation 'com.pierfrancescosoffritti.androidyoutubeplayer:core:8.0.1'. You can also remove maven { 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.