7

The question is easy :)

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

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

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

I'm using this to launch the activity:

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

But the video starts from the begining :(

Thanks

Tyler
  • 21,762
  • 11
  • 61
  • 90
HyLian
  • 4,999
  • 5
  • 33
  • 40
  • This was asked over a month ago, and there are no answers, so I assume there is currently no way to do this. Maybe we should submit it to Google as a feature request. Would http://code.google.com/p/android/issues be the right place to do that? – Tyler Dec 18 '10 at 19:44
  • You seem to be right, using the intent it seems it isn't possible after all. But i'm open to alternatives. Maybe using the Android Media Player?. – HyLian Dec 18 '10 at 20:20

1 Answers1

4

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.

hunterp
  • 15,716
  • 18
  • 63
  • 115
  • Can you add a sample with the GData API nedded to get the 3gp video? :) thanks! – HyLian Dec 22 '10 at 09:47
  • 1
    http://stackoverflow.com/questions/524257/best-option-for-using-the-gdata-apis-on-android – hunterp Dec 22 '10 at 17:02
  • True but quality is really low. You only get mobile stream which is nowhere near quality of music you get from YT intent – wonglik Jan 27 '13 at 10:45