Home Development for Android Features of working with VideoView

Features of working with VideoView

by admin

Does this picture look familiar?
Features of working with VideoView
Recently had a chance to develop a mobile app that had to play a video supplied by one service. And had to face some problems, about which I want to report.
First of all, video from the Internet does not play on the emulator. All attempts resulted only in "Cannot play video" error. This is certainly unpleasant, but not fatal.
Much worse the second one : VideoView turned out to be really picky about the connection. Every now and then it would show what is on the picture. More often it happened on the playback, but in the process of playback also happened.
Also, strange things were happening with the buffering. Even with 100% buffering, if you scroll back through the video, the buffer resets to the position we went to.
I had to try different solutions. The best one was to download the whole video and play it from a local file. But with the file size > 20 MB it took a long time, so I had to give up that idea too.
Of course, I wondered if this was a common problem for android or if it was me doing something wrong. I had to do a resurvey of similar software.

YouTube native app

It works fine for me, no problems noted. However, the network found a lot of complaints about unstable operation and periodic player crashes with a bad connection. Here are examples :

GiantBomb

A client application for some GiantBomb service. The application was especially attractive because its source code is open (http://code.google.com/p/giantbomb-android/). But, unfortunately I haven’t managed to watch any video with it – only crashes with this error occurred (by the way, this screenshot is from this very application).

SPB TV 2

Worked steadily, no crashes noted. True, and the plots there are no more than a minute.

How did it all end?

Right now in my application it just works VideoView , but there are checks all over the place for what is buffered enough. I should have changed the tariff with my ISP and the error never happened again. However, with a bad connection the problem still sometimes appears.
And the purpose of this article is to warn those who are going to work with VideoView , and to get comments from those who have relevant experience.

You may also like