YouTube Android Player API deprecated in 2023 so how can Implement youtube player in android studio
Asked Answered
M

4

6

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

Mande answered 15/3, 2023 at 6:32 Comment(0)
K
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

Knightly answered 15/3, 2023 at 6:39 Comment(2)
Last commit 6 years ago?Mendelian
But it still working fine @MendelianMande
P
7

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.

Pippy answered 5/4, 2023 at 10:40 Comment(10)
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.Antaeus
I don't know what will happen with the official player once it's deprecated. I am not involved with it.Pippy
this player sometimes does not work I think it has some limited request to play a videoWentletrap
The player should work fine all the time. Feel free to open an issue on the GitHub project.Pippy
@PierfrancescoSoffritti I am using your iframePlayer now, works perfectly! I wonder if I could block ads when using iframePlayerAntaeus
You shouldn't as that's against YouTube's terms of service. But if you really want to there should be a workaround in the lib's doc.Pippy
A simple library, thanksIdeologist
@PierfrancescoSoffritti, I wonder whether this library would solve my issue. I am trying to implement a way to access YouTube from AR glasses. To me, this is not infringement of Terms of Services. Yet, if I attempt to mirror the left eye's screen to the right eye's screen, YouTube doesn't let me do it. My pair of AR glasses has a logical screen where left part is displayed on left eye and right part on right eye, meaning I need to display the whole page including the video twice (binocular fusion). Is your library a potential solution for this problem?Printable
@Printable this sounds very strange, the glasses should take care of the stereo rendering, like it happens in VR. Duplicating the entire UI manually doesn't seem like a good idea.Pippy
@PierfrancescoSoffritti It's basic Android AR glasses, RayNeo X2, and the logical screen is the left and right eye side by side. They withhold details of their sdk documentation so I basically try to reimplement the binocular fusion myself to have more control. Any suggestion is greatly appreciated.Printable
K
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

Knightly answered 15/3, 2023 at 6:39 Comment(2)
Last commit 6 years ago?Mendelian
But it still working fine @MendelianMande
B
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

Buoyancy answered 14/6, 2023 at 19:30 Comment(0)
P
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

Pozzuoli answered 27/7, 2023 at 17:34 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.