tags:

views:

38

answers:

1

Hi

I 'm opening a video file (3gp) file using code below

    String url = "rtsp://v5.cache4.c.youtube.com/CkELENy73wIaOAliq6nKYdHZZxMYESARFEIJbXYtZ29vZ2xlSARSBWluZGV4Wgl4bF9ibGF6ZXJg7sXyzsWH3ZlMDA==/0/0/0/video.3gp";
    Intent i = new Intent(Intent.ACTION_VIEW);
    i.setData(Uri.parse(url));
    startActivity(i);

I can also play the url using MediaController and using its holder and Display.

What's the difference between the two methods. Both are available for Android 1.5

A: 

First off, you shouldn't use YouTube URLs like that; I'd recommend reading through the YouTube TOS.

Having said that, the difference between the two approaches is that (a) startActivity on an ACTION_VIEW Intent with a video URL like that will trigger the OS's built-in chromeless video player, which is very bare-bones. On the other hand, (b) if you define your own Activity to show the video, you'll have more flexibility to define what kinds of controls and presentation to display the video with.

Roman Nurik
Thanks Roman. Quite new to this paradigm of Terms And Conditions do didn't know thats its against the YouTube TOS to use these URLsWill take care to that now onwards .. thanks
success_anil
Sure, in general it's not a good idea to use URLs that aren't publicly exposed like that. You may want to look at the official YouTube APIs to see what is/isn't allowed from a YouTube developer perspective.
Roman Nurik