I am trying to embed a youtube video in an android app using the Youtube API. I imported the jar, added it to my build path, and added a YouTubePlayerView to my main view. In the onCreate I have the following code with my key where xxxx is :
YoutubePlayerView ytpv = (YouTubePlayerView) findViewById(R.id.youtubeplayer);
ytpv.initialize("xxxx", this);
When I run the app I get the exception :
java.lang.SecurityException: Not allowed to bind to service Intent { act=com.google.android.youtube.api.service.START }
When I try to run the same app that comes with the api it seems to work fine. Any ideas?
I think you forgot to add permission:
<uses-permission android:name="android.permission.INTERNET"/>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With