【问题标题】:Fullscreen mode in android youtube applicationandroid youtube应用程序中的全屏模式
【发布时间】:2012-04-25 06:08:19
【问题描述】:

我有用于启动 android youtube 应用程序的代码

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);

如何强制此应用程序在 android 3.2 中以全屏模式显示视频? 并且不要建议 videoview 和 embed player - 这种方法对我不起作用

【问题讨论】:

    标签: android android-intent youtube youtube-api youtube-javascript-api


    【解决方案1】:

    对于 YouTube v4.1.47,您可以执行以下操作:

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

    它可能适用于旧版本,但我还没有测试过。

    【讨论】:

      猜你喜欢
      • 2011-11-10
      • 2020-04-11
      • 2012-06-21
      • 2012-10-31
      • 2014-10-07
      • 2014-10-28
      • 1970-01-01
      • 2017-01-19
      • 1970-01-01
      相关资源
      最近更新 更多