Reputation: 4121
I need a way to automatically play a YouTube video on my Google Glass. I tried the Youtube JS API but after .playVideo() the video doesn't play, it only shows a black screen. I tried embed the video with the autoplay function but it doesn't autoplay. I can play embedded videos only when I click the play button myself.
Is there a simple way to (auto)play a youtube video full screen?
Upvotes: 0
Views: 228
Reputation: 7516
If you want to have full control over the video player, you can use the YouTube Android Player API.
You can find more info here.
You'll have to:
YoutubePlayer
in your Activity
Take a look at the demo, and especially at the FullscreenDemoActivity
.
Edit: A simpler method would be to use this Intent:
Intent i = new Intent();
i.setAction("com.google.glass.action.VIDEOPLAYER");
i.putExtra("video_url", "https://m.youtube.com/watch?v=xxxxxxx");
startActivity(i);
Upvotes: 1