【问题标题】:How to play YouTube video via Intent?如何通过 Intent 播放 YouTube 视频?
【发布时间】:2013-08-23 12:08:30
【问题描述】:

在我的应用程序中,我想单击特定按钮并跳转到 youtube 应用程序并显示 youtube 用户。例如 http://www.youtube.com/user/punjabiradiousa 。这怎么可能请建议一些技术?

【问题讨论】:

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


【解决方案1】:

这样做:

startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("http://www.youtube.com/user/punjabiradiousa")));

取自这里:Android YouTube app Play Video Intent

【讨论】:

    【解决方案2】:

    这段代码我用来播放 youtube 视频

    Matcher matcher = Pattern.compile("http://www.youtube.com/embed/").matcher(mVideoId);
    matcher.find()
    Intent lVideoIntent = new Intent(
                                    null,
                                    Uri.parse("ytv://" + mVideoId),
                                    MainScreen.mContext,
                                    com.kids.youtube.OpenYouTubePlayerActivity.class);
                                    startActivity(lVideoIntent);
    

    【讨论】:

      【解决方案3】:

      它的工作原理

      startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("")));
      

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2012-11-11
        • 2012-03-17
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多