使用YouTube意图从给定的起始点推出视频 [英] Using Youtube Intent to launch a video from a defined starting point

查看:183
本文介绍了使用YouTube意图从给定的起始点推出视频的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

现在的问题很简单:)

我想从定义的起始位置开始的YouTube视频。

I want to start a youtube video from a defined starting position.

在一个普通浏览器,可以通过附加一个#T = 1m20s在网址的结尾一样实现这一点:

In a regular browser, you can achieve this by appending a #t=1m20s at the end of the url like in:

http://www.youtube.com/watch?v=HKdsra1O20Y# T = 30m10s

不过,如果我使用该URL的意图,Android的播放器是不是把开始在这一点上。

But If I use that URL in the Intent, the Android player is not putting the start at that point.

我用这个来启动活动:

startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("http://www.youtube.com/watch?v=HKdsra1O20Y#t=30m10s")));

不过,从一开始的视频开始:(

But the video starts from the begining :(

感谢

推荐答案

您可以方便地使用谷歌的GData API调用下一个YouTube 3GP视频,那么你要做的就是加载3GP在MediaPlayer的情况下,你可以很容易地使用其seekTo方法。

You can easily use the Google Gdata api to call down a youtube 3gp video, then all you do is load the 3gp in a MediaPlayer instance which you can easily use its seekTo method.

这篇关于使用YouTube意图从给定的起始点推出视频的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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