Streaming Video (or Progressive Download) to the Droid Browser

落花浮王杯 提交于 2019-11-30 09:36:10

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

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.

I am not entirely sure about this but I don't think it's really possible.

As far as I know "supported" only means it can play it out of the box, but there are no plugins for the browser so it doesn't know that to do with it.

If you want to validate if Android can play the file, put it on the SD card and play it through the Gallery.

Playing a mp4 file from the browser is supported. If you have a particular link that is not working, please post the link. Also, it would be helpful to see what "adb logcat" shows.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!