VideoView and progressive loading

In my application, I need to give the user a preview in progressive download (video file).

To achieve this, I use a component VideoViewto display the contents of the downloaded video (.mp4, .3gpp).

The problem is that I cannot access the remote media through the protocol http://or rtsp://, therefore, I have to use VideoView.setVideoPathto play a local copy of the video at boot time.

Unfortunately, on Android devices that cannot use the StageFrightframework (therefore OpenCore, some Tegra2-baseddevices in my experience), VideoViewit cannot correctly handle progressive downloads: it can play only part of the video recognized during component initialization.

So, to be clear: if the user clicks β€œplay” when only 5% of the video is uploaded, VideoView will show only 5% of the video, regardless of whether more video content has been downloaded.

In my experience, this problem does not affect devices that use infrastructure StageFright(for example, Nexus One 2.2, Nexus One 2.3.4).

Can someone point me to a possible solution? thanks in advance

+5
source share
2 answers

If you are trying to play .h264, you need to move the MOV atoms to the beginning of the file. They tell the codec about the length of the film, among other things.

try qtfaststart

http://ffmpeg.zeranoe.com/builds/

+2
source

VideoView is a ready-to-use class in the Android Application Framework for use in video playback mode. To achieve playback, it internally uses the MediaPlayer class. MediaPlayer uses multimedia environments that are available based on certain criteria, such as file format, content source, etc.

, , VideoView. VideoView, . .

Android ( stagefright) .

, DownloadManager http- -/- .

Shash316

+1

All Articles