YouTubeAndroidPlayerApi library play YouTube videos without a real GCP Api key

Viewed 15

I am using the YouTubeAndroidPlayerApi library a youtube video playback in application. Specification-Version: 1.2.2

gradle dependency:

implementation files('libs/YouTubeAndroidPlayerApi.jar')

I noticed the strange behavior of the library. The documentation says that need to Use the API key created in the GCP Console. But during testing it turned out that the video is played without a real key. Below is an example test:

Test 1. I'm using the wrong or random API key:

val API_KEY = "QWERTYUIDFGHJKL" // wrong or random API key
YouTubePlayerSupportFragment.newInstance().initialize(API_KEY, object : YouTubePlayer.OnInitializedListener {...})

Surprisingly video video is played with this api_key.

Test 2. I use empty string instead of API key:

val API_KEY = "" // empty API key
YouTubePlayerSupportFragment.newInstance().initialize(API_KEY, object : YouTubePlayer.OnInitializedListener {...})

Video is playing in my app with this code

Can you please tell me why the video plays without a real GCP Api key?

Thanks!

0 Answers
Related