开发者

Difference between Intent.ACTION And Video View

开发者 https://www.devze.com 2023-01-09 06:23 出处:网络
I \'m opening a video file (3gp) file using code below String url = \"rtsp://v5.cache4.c.youtube.com/CkELENy73wIaOAliq6nKYdHZZxMYESARFEIJbXYtZ29vZ2xlSARSBWluZGV4Wgl4bF9ibGF6ZXJg7sXyzsWH3ZlMDA==/0/0/0

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开发者_JS百科 Android 1.5


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消