I have a webview, and I want to detect when a user clicks on a link ending
with .mp4 and then launch an intent to play the video.

For example, (NSFW) if the user clicks on
http://ec.tc.members-access.com/nhp/episode/8529_0450.mp4

I have been doing:

 Intent i = new Intent(Intent.ACTION_VIEW , Uri.parse(url) );

  startActivity(i);

In Android 1.6 on my G1, this code will launch the web browser which will
then launch the video player with the video.

In Android 2.2, on my Nexus One, this will launch the web browser which will
then immediately exit.

If I add  i.setType("video/*"), then the video app will be launched, but
will immediately crash with a null pointer error.

Also, on Android 2.2, if I email myself the link, and click on it, it will
launch the browser and immediately exit.  But, if I copy the link and paste
it into the address bar on the browser, it will launch the video app and
correctly play the video.

So, what is the proper way to play a MP4 video, given a url, that will work
on all devices?

Thanks,

Randy

-- 
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en

Reply via email to