7

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

asked Mar 15, 2023 at 6:32

4 Answers 4

8

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.

answered Apr 5, 2023 at 10:40
Sign up to request clarification or add additional context in comments.

10 Comments

Hi Mr.Soffritti, I wonder if I keep using Youtube android player api in my app after May, 1, will my app going to crash or the video player will broke? Thanks in advance.
I don't know what will happen with the official player once it's deprecated. I am not involved with it.
this player sometimes does not work I think it has some limited request to play a video
The player should work fine all the time. Feel free to open an issue on the GitHub project.
@PierfrancescoSoffritti I am using your iframePlayer now, works perfectly! I wonder if I could block ads when using iframePlayer
|
1

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

answered Mar 15, 2023 at 6:39

2 Comments

Last commit 6 years ago?
But it still working fine @Michalsx
0

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

answered Jun 14, 2023 at 19:30

Comments

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

answered Jul 27, 2023 at 17:34

Comments

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.