使用YouTube意图从给定的起始点推出视频意图、起始点、视频、YouTube

2023-09-06 04:14:59 作者:26.剑噬の天下

现在的问题很简单:)

我想从定义的起始位置开始的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.