Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Streaming Video (or Progressive Download) to the Droid Browser

I am trying to stream video (or use progressive download) to a Motorola Droid Browser and am not having a lot of luck. With my iPhone, I can direct Safari to http://xxx.xxx.xxx/FileName.mp4 (which is an MPEG-4 video file), and Safari opens quicktime, and the video plays. However, with the Droid, I go to the same web address and am faced with a error stating "Cannot play video.... Sorry, this video is not valid for streaming to this device".

When I direct the Droid's browser to a WMV file, it will fully download the video file and then play it in what appears to be the Droid video player if I click on it.

Ideally, I'd like to replicate the behavior of the iPhone on the Droid, where the video player pops up and the video starts before the complete download. Video format isn't an issue, as I can encode the video to pretty much any standard. I was trying the .mp4 file because the Droid documentation says that it supports MPEG-4 video, although I can't get it to work from the browser.

Any insight would be much appreciate.

like image 359
TheJerkMan24 Avatar asked Jan 22 '10 19:01

TheJerkMan24


2 Answers

You should launch an intent and set the type to "video/*" so that it opens directly with a video player instead of the browser.

like image 177
Error 454 Avatar answered Sep 21 '22 06:09

Error 454


Streaming in Android is a pain in the ass. The best option is to stream the video with RTSP protocol.

If your Droid is updated to 2.2 you can also set up a simple webpage with an embedded Flash player like jwplayer (don't forget to set up alternate content when Flash player is not installed on the device so the user can download it from Adobe).

I successfully deployed both solutions. RTSP for <2.1 and embedded Flash player playing video from RTMP stream (you can also play local file from the server)

Note that in some devices (Hero) you can't embed the WebView with the Flash player inside your app.

If you look for a fast solution I would give a try to 3gp.

Also, when connectivity is not fast enough to play the video you will get that same error you posted (even with properly encoded videos).

EDIT: I used H.264 on RTSP streams and VP6 on RTMP. VP8 is supported by newer devices only.

like image 35
momo Avatar answered Sep 20 '22 06:09

momo