3

I want to play youtube video inside viewpager, I ready documentation where mentioned that download the youtube android player api sk . But in the documentation youtube player documentation showing it is deprecated so how can I implement this.

I want to play youtube video link in youtube playerview with play pause funtionality which is provided by default by youtube. and when it slide it will stop automatically.

Youtube player image

Want to implement like this :-

enter image description here

4 Answers4

4

As they say in the banner, you should use the IFramePlayer API inside a Webview.

Otherwise you can use this library (I am the owner): android-youtube-player. It uses the IFrame Player API inside a Webview but offers a native interface to it, so you can use Java/Kotlin to interact with the player.

Pierfrancesco Soffritti
  • 1,678
  • 1
  • 18
  • 22
0

Youtube-Android-Player-Helper(YTPlayer)

Helper library for Android developers looking to add YouTube video playback in their applications via the iframe player in WebView

dependencies {
  compile 'com.jaedongchicken:ytplayer:1.4.4'
}

https://github.com/JackDinealKIM/youtube-android-player-helper

Ashfaque
  • 179
  • 4
0

The YouTube Android Player SDK (version 1.2.2) is no longer supported or maintained by YouTube. This SDK should not be used, due to security vulnerabilities. Please use the YouTube IFrame Player API instead.

The SDK is no longer available for download. It will be fully deprecated on or after May 1, 2023.

You get the below error going forth -

enter image description here

Anoop M Maddasseri
  • 10,213
  • 3
  • 52
  • 73
-1

I have created an simple implementation using iframe webview as official player has been deprecated due to security vulnerabilities...

Here's sample link of a project

https://github.com/epegasus/YoutubePlayer

Sohaib Ahmed
  • 1,990
  • 1
  • 5
  • 23