I am trying to implement a list view with a video as its elements. I use this project to display video by texture. It uses MediaPlayer from below. It does not work (most of the time) when downloading two videos at the same time.
The error I get is:
TextureVideoView error. File or network related operation errors. MediaPlayer: error (1, -2147479551)
and this also happens when a file is loaded from disk
In terms of error handling, I tried resetting the URL. Then I basically get
E/BufferQueueProducer: [unnamed-30578-12] disconnect(P): connected to another API (cur=0 req=3)
mistake. It’s not clear to me that installing some videos from the Internet will work, but trying again to skip the same URL will fail.
So, in OnErrorListener:
textureView.setVideo(item.getUriMp4(),MediaFensterPlayerController.DEFAULT_VIDEO_START);
will fail, but:
textureView.setVideo("http://different.video" ... )
will work great.
This is also not a problem with a specific file, as it will crash when scrolling through various video files. Sometimes those that don't work will work the next time, etc.
I also tried using a combination of MediaCodec and MediaExtractor instead of the MediaPlayer approach, but I came across what it looks like, a specific device platform error
any clues? any suggestions?
thanks
w.
android android-listview video mp4 android-mediaplayer
wonglik
source share