play video while downloading on Android

别来无恙 提交于 2019-12-13 15:25:31

问题


Is it possible to stream video while downloading video on ‘Android’ using secure asp.net application?

I have a https secure asp.net web application. This application is exclusively made for mobile devices (e.g Iphone, BB, Android etc...) called as Mobi web in otherwords, I have an asp.net web site that user will browse on a mobile device. I have some video files loaded on this site. These videos can be played by clicking on corresponding hyperlink of respective video. When I click on these hyperlinks from Iphone or Ipad , these videos get streamed on screen and gets played properly. Till this point all works smooth and fine.

Now when I test the same functionality on ‘Android’ my video file gets downloaded on device but don’t get played of its own. Initially it was concluded that converting these files to indigenous device compatible video file types will help video files to get auto streamed. Hence I used a converter to convert all type of video files to ‘3gp’ for ‘Android’ and tested but found that in this case also, the video files gets downloaded and do not get played on their own. I tried various approaches to download video files like I used Response.Redirect, then I used binary reader and then the 3gp handler. Nothing worked.

Does anybody know how to play video while downloading on Android? Thank you very much!


回答1:


Android can play MP4 video progressively if the 'moov' atom is at the beginning of the video. The moov atom is a part of the file that holds index information for the whole file. After converting the video you can use qt-faststart from ffmpeg(http://www.ffmpeg.org) to move the 'moov atom' at the beginning. You can also try playing 3gp files after 'hinting' them by using MP4Box (http://www.videohelp.com/tools/mp4box). I tried this before for 3gp files for android and that worked for me.




回答2:


The problem is not with the videos, but with the HTTPS protocol. If any HTTPS url is given to the media player (doesn't matter if it is through some native application or browser app), the android system would download the file completely before you can play it.

This behavior is actually well documented, But here is a link for your info

http://groups.google.com/group/android-developers/browse_thread/thread/7e7003b845c3fb98#



来源:https://stackoverflow.com/questions/5715674/play-video-while-downloading-on-android

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