3

When I play some MP4s on VideoView it works for the first time I do it on particular device, but then every next time I'm trying to play this video again I'm having

W/MediaHTTPConnection: readAt 2862802 / 32768 => java.net.ProtocolException E/MediaPlayer: error (1, -2147483648) E/MediaPlayer: Error (1,-2147483648)

It happens until I clear app's data. Then again I can play that video once.

Although, clearing data once doesn't always help. Sometimes I have to do it a few times. What's more there have been cases when video played a few times in row without clearing data.

Another thing is that another videos which are encoded the same don't cause any problems...

Is VideoView storing somehow videos which has been already played and using it next time it is played? If so, is there any possibility to manage it?

Mikolaj
  • 126
  • 3

1 Answers1

1

In my personal experience, we had to do one of two things to get around that error (the error being unknown error, basically).

We either had to A, buffer or download the videos ourselves (the one built into VideoView does not seem to work properly, and it feels as though it's been since 2.x that it has even been updated) or B, re-encode the video (newer MP4 codecs seem to be too complex for the default VideoView implementation - using Adobe's Media Encoder, we could re-encode with older specs). This is a good guide to follow for that: http://developer.android.com/guide/appendix/media-formats.html

You're also probably better using MediaPlayer - something I've had to resort to (isn't a bad thing, just definitely not as quick or easy as VideoView)

There's a few other questions that give insight to this:

Android MediaPlayer/VideoView error (1, -2147483648)

Android MediaPlayer error (1, -2147483648)

Community
  • 1
  • 1
Thyme Cypher
  • 73
  • 1
  • 9