user1659006
user1659006

Reputation: 373

The most adaptable way to play YouTube Video in android application

I did google about this question and I found 4 possible ways to do it:

  1. play the video with the following manner:
    startActivity(newIntent(Intent.ACTION_VIEW,Uri.parse(uri)));
  2. Get the RTSP link and play the video with VideoView
  3. play the video using Flash
  4. Using HTML5 iframe

I have an android 4.0 device and I am able to play YouTube videos using the first three methods. My question is: which method is the most adaptable to different version. If the answer is using HTML5, how can I do it. Thank you very much for your time.

Upvotes: 0

Views: 117

Answers (1)

Magakahn
Magakahn

Reputation: 508

The most allround way of doing it to open it with a URI parse. There is also a way of forcing the YouTube app to be called(sorry I think I read it someplace but I do not remember how) and show the video there. This means you do not get the option to chose to open the video in the browser.

The rest of the alternatives are only supported by some devices. (Flash is outdated, HTML5 is not supported on most devices). I you are going to do something else then using the buildt-in YouTube app I would recomend RTSP as the best option.

Upvotes: 1

Related Questions