嵌入YouTube的视频转换成Android应用程序使用Eclipse? [英] Embedding a youtube video into android app using eclipse?

查看:111
本文介绍了嵌入YouTube的视频转换成Android应用程序使用Eclipse?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图找出如何使用Eclipse中嵌入YouTube视频到机器人。我想preFER使用无铬的球员,但在这一点上是没有必要的。

I'm trying to figure out how to embed youtube videos into android using eclipse. I would prefer to use the chromeless player, but at this point it's not necessary.

这是如何做到这将是极大的AP preciated任何帮助。

Any help on how to do this would be greatly appreciated.

推荐答案

嵌入YouTube视频的最简单方法是使用意图火的Youtube应用程序,像这样的:

The easiest way to embed a Youtube video is to use an intent to fire the Youtube application, like this:

String video_path = "http://www.youtube.com/watch?v=opZ69P-0Jbc";
Uri uri = Uri.parse(video_path);

// With this line the Youtube application, if installed, will launch immediately.
// Without it you will be prompted with a list of the application to choose.
uri = Uri.parse("vnd.youtube:"  + uri.getQueryParameter("v"));

Intent intent = new Intent(Intent.ACTION_VIEW, uri);
startActivity(intent);

这篇关于嵌入YouTube的视频转换成Android应用程序使用Eclipse?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆