Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android Youtube API error YouTubePlayerView

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?

like image 1000
user1200083 Avatar asked Mar 04 '13 03:03

user1200083


1 Answers

I think you forgot to add permission:

<uses-permission android:name="android.permission.INTERNET"/>
like image 140
The Finest Artist Avatar answered Sep 27 '22 21:09

The Finest Artist