YouTube embedded playback in Android Kotlin app fails with error 152-4 even though onReady fires Body

2 days ago 2
ARTICLE AD BOX

I am building an Android education app in Kotlin where lessons are organized by course, grade, and chapter, and videos are played from YouTube.

To isolate the issue, I created a fresh minimal Android test app. There is no backend, no playlist logic, and I am testing with a single hardcoded video ID.

Setup

-

Android Studio

Kotlin

com.pierfrancescosoffritti.androidyoutubeplayer:core

Single hardcoded video ID

No backend involved

No playlist involved

What happens
The player initializes successfully, and onReady() fires, but both cueVideo(...) and loadVideo(...) fail.

On-screen YouTube error:152-4

Library callback: Player error: UNKNOWN

Relevant logs

A. onCreate entered 1. Activity started. Target Video ID: [rDo-GlvNsUc] (Raw: [rDo-GlvNsUc]) Internal WebView found and settings applied. B. initialize called C. initialize returned Activity onStart Activity onResume D. onReady fired Player width: 2020, height: 1080 E. calling cueVideo with [rDo-GlvNsUc] F. onError fired: [UNKNOWN] onVideoId: rDo-GlvNsUc F. onError fired: [UNKNOWN]

Minimal code

youtubePlayerView.addYouTubePlayerListener(object : AbstractYouTubePlayerListener() { override fun onReady(youTubePlayer: YouTubePlayer) { Log.d("YT", "onReady fired") youTubePlayer.cueVideo("rDo-GlvNsUc", 0f) } override fun onError(youTubePlayer: YouTubePlayer, error: PlayerConstants.PlayerError) { Log.d("YT", "onError fired: [$error]") } })

What I already ruled out

Backend or API issue

Bad video ID parsing

View size issue

Calling player methods before onReady()

Playlist parsing issue

Server or storage issue

Same failure happens in a fresh minimal app created from scratch

Question
What does YouTube error 152-4 mean in this Android embedded playback context?

Is this usually caused by:

The specific video having embedding disabled

YouTube restricting playback more aggressively in Android app or WebView embeds

This library no longer working reliably with current YouTube embed behavior

I am trying to determine whether this is a video-specific restriction, a YouTube-side change, or an Android WebView/library issue.

If you want, I can also give you an even more Stack Overflow-optimized version that sounds a little more technical and less likely to get nitpicked.

Read Entire Article