android-youtube-player icon indicating copy to clipboard operation
android-youtube-player copied to clipboard

It has completely stopped working

Open WEST-HINO opened this issue 6 months ago • 5 comments

Hi Team,

Your library is really great.

I had been using your service conveniently, but it completely stopped working a few days ago. Could you please let me know if there is any solution or workaround? I would appreciate your help.

Thank you.

WEST-HINO avatar Jun 19 '25 00:06 WEST-HINO

I ran into this exact issue. It was really serious. No detailed exception was thrown.

For me, the workaround now is use v12.1.0 instead of 12.1.1 implementation 'com.pierfrancescosoffritti.androidyoutubeplayer:core:12.1.0'

longld103 avatar Jun 19 '25 02:06 longld103

I ran into this exact issue. It was really serious. No detailed exception was thrown.

For me, the workaround now is use v12.1.0 instead of 12.1.1 implementation 'com.pierfrancescosoffritti.androidyoutubeplayer:core:12.1.0'

Thank you for your response. After switching to version 12.1.0, playback is now working correctly. I'll try this for now.

WEST-HINO avatar Jun 19 '25 05:06 WEST-HINO

Confirmed, going back to 12.1.0 is working correctly, just to specify the isue, I can see two lines of problems with chromium:

2025-06-19 11:29:02.646 4086-4086 chromium I [INFO:CONSOLE:187] "Unrecognized feature: 'web-share'.", source: https://www.youtube.com/s/player/9fe2e06e/www-widgetapi.vflset/www-widgetapi.js (187) 2025-06-19 11:29:02.653 4086-4086 chromium I [INFO:CONSOLE:196] "Uncaught Error: Invalid video id", source: https://www.youtube.com/s/player/9fe2e06e/www-widgetapi.vflset/www-widgetapi.js (196)

kuznikowski avatar Jun 19 '25 08:06 kuznikowski

2025-06-19 10:21:56.160  4168-4168  chromium                com.~~~~~.~~~~~             I  [INFO:CONSOLE:187] "Unrecognized feature: 'web-share'.", source: https://www.youtube.com/s/player/9fe2e06e/www-widgetapi.vflset/www-widgetapi.js (187)
2025-06-19 10:21:56.191  4168-4168  chromium                com.~~~~~.~~~~~              I  [INFO:CONSOLE:196] "Uncaught Error: Invalid video id", source: https://www.youtube.com/s/player/9fe2e06e/www-widgetapi.vflset/www-widgetapi.js (196)

I ran into this exact issue. so i use manage cookie and webstroage like this

delay(3000L) val cookieManager = android.webkit.CookieManager.getInstance() cookieManager.removeAllCookies(null) cookieManager.removeSessionCookies(null) cookieManager.setAcceptCookie(false)//i use true but it's make same issue so i use false cookieManager.flush() WebStorage.getInstance().deleteAllData() println("cookie clear") delay(4000L) println("is running?") //todo refresh

it works my project so i used it. but sometimes make same issue.

PotatoMeme avatar Jun 19 '25 09:06 PotatoMeme

Confirmed, going back to 12.1.0 is working correctly, just to specify the isue, I can see two lines of problems with chromium:

2025-06-19 11:29:02.646 4086-4086 chromium I [INFO:CONSOLE:187] "Unrecognized feature: 'web-share'.", source: https://www.youtube.com/s/player/9fe2e06e/www-widgetapi.vflset/www-widgetapi.js (187) 2025-06-19 11:29:02.653 4086-4086 chromium I [INFO:CONSOLE:196] "Uncaught Error: Invalid video id", source: https://www.youtube.com/s/player/9fe2e06e/www-widgetapi.vflset/www-widgetapi.js (196)

How can I fix this error?#

brotechapp avatar Jun 19 '25 18:06 brotechapp

I have the same error but randomly :

2025-06-19 10:21:56.160  4168-4168  chromium                com.~~~~~.~~~~~             I  [INFO:CONSOLE:187] "Unrecognized feature: 'web-share'.", source: https://www.youtube.com/s/player/9fe2e06e/www-widgetapi.vflset/www-widgetapi.js (187)
2025-06-19 10:21:56.191  4168-4168  chromium                com.~~~~~.~~~~~              I  [INFO:CONSOLE:196] "Uncaught Error: Invalid video id", source: https://www.youtube.com/s/player/9fe2e06e/www-widgetapi.vflset/www-widgetapi.js (196)

I use the version 12.1.0 yet and yesterday for a while stopped to work and after it started working again without me doing anything. Today, for some reason, it stopped works again.

Ps. I'm sure about the videoId

Edit: It started working again without me making any changes, I'm afraid the problem might be coming from YouTube.

ctrlVnt avatar Jun 20 '25 10:06 ctrlVnt

Hi, thanks for reporting this issue. I can see the same happening in the sample app. Nothing change in the library, this means that something changed on YouTube's side. This is strange since changes in the IFrame Player should not affect the library.

In the sample app everything works fine with the "simple example", but not with the "complete example", so there must be something there.

I will try to take a look in the evening, but if you can please help debugging the issue in the meantime.

PierfrancescoSoffritti avatar Jun 20 '25 12:06 PierfrancescoSoffritti

According to #1224 this is caused by onReady not being called when automatic initialization is used.

PierfrancescoSoffritti avatar Jun 20 '25 12:06 PierfrancescoSoffritti

Hey @PierfrancescoSoffritti,

Same issue here ! For me, it's not working on a fresh install, even after restarting the app.

But when clearing the cache and removing data, the player is initializing correctly !

FF-GoAndUp avatar Jun 20 '25 16:06 FF-GoAndUp

It looks like sometimes the videoId is undefined in the IFrame Player. This was caused by #1169 .

These are the workarounds until I release a fix:

  1. Pass the videoId when initializing the player, like youTubePlayerView.initialize(youTubePlayerListener, false, iFramePlayerOptions, "videoId")
  2. Downgrade the library to version 12.1.0.

Sorry for this issue, it slipped through code review.

PierfrancescoSoffritti avatar Jun 21 '25 06:06 PierfrancescoSoffritti

I have landed a fix in dev, I will close this issue once i release a new version on maven

PierfrancescoSoffritti avatar Jun 21 '25 08:06 PierfrancescoSoffritti

Version 12.1.2 is now released, the issue should be fixed :)

PierfrancescoSoffritti avatar Jun 22 '25 07:06 PierfrancescoSoffritti