Thursday, January 31, 2013

Android Youtube Player Api - ERROR_CONNECTING_TO_SERVICE

I'm trying to use the new api youtube. I followed the examples provided, but I get the error: ERROR_CONNECTING_TO_SERVICE

The "API key" that I'm using is correct (since it works correctly in the google demos).

Imports:

import com.google.android.youtube.player.YouTubeBaseActivity; import com.google.android.youtube.player.YouTubeInitializationResult; import com.google.android.youtube.player.YouTubePlayer; import com.google.android.youtube.player.YouTubePlayer.Provider; import com.google.android.youtube.player.YouTubePlayerView; 

Classe definition:

public class Track extends YouTubeBaseActivity implements YouTubePlayer.OnInitializedListener {       private YouTubePlayerView ytpv;      private YouTubePlayer ytp;       public void onCreate(Bundle savedInstanceState) {           ...            ytpv = (YouTubePlayerView) findViewById(R.id.youtube_view);           ytpv.initialize("my_api_key_correctly_created", this);       }       public void onInitializationFailure(Provider arg0, YouTubeInitializationResult arg1) {           Toast.makeText(this, "Initialization Fail" + arg1.toString(), Toast.LENGTH_LONG).show();      }        public void onInitializationSuccess(Provider arg0, YouTubePlayer arg1, boolean arg2) {           ytp = arg1;           Toast.makeText(this, "Initialization  Success", Toast.LENGTH_LONG).show();            if(ytp !=null)           {                ytp.loadVideo("ZvvgDC_MNqI");           }      } } 

What am I doing wrong? Thank you, and sorry my english:)

Source: http://stackoverflow.com/questions/14604280/android-youtube-player-api-error-connecting-to-service

seattle weather skier sarah burke gingrich wife cheryl burke sarah burke mega upload santorum wins iowa

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.