0

J'ai code pour Lauch une application youtube androiden mode Plein écran en application youtube android

private String video_id[] = { "gZiKrWSzNBo", "mzpJq23cuKc" }; 
private final static String YOUTUBE_URL = "http://www.youtube.com/watch?v="; 
private final static String YOUTUBE_APP = "com.google.android.youtube"; 

Intent youtube_intent = new Intent(); 
youtube_intent.setPackage(YOUTUBE_APP); 
youtube_intent.setAction(Intent.ACTION_VIEW); 
youtube_intent.setData(Uri.parse(YOUTUBE_URL + video_id[position] 
       + PLAYER_PARAMETERS)); 
     startActivity(youtube_intent); 

Comment puis-je forcer cette application pour afficher la vidéo en mode plein écran dans Android 3.2? Et ne suggèrent pas VideoView et lecteur Embed - ces méthodes ne fonctionne pas pour moi

Répondre

2

Comme pour v4.1.47 YouTube, vous pouvez effectuer les opérations suivantes:

Intent playIntent = new Intent(Intent.ACTION_VIEW); 
playIntent.setData(Uri.parse(<yout_YouTube_url>)); 
playIntent.putExtra("force_fullscreen", true); 

Il pourrait fonctionner sur les versions plus anciennes, mais je Je ne l'ai pas testé.

+0

Merci, cela fonctionne très bien pour moi! –

Questions connexes