VideoView with a ListView
Asked Answered
F

0

1

I am relative new to Android development. I am working on an app where it is a specific client requirement that I have a scrollable list of videos. These videos must be playable within the scrolling list as embedded views.

My first thought was to use VideoViews in a ListView and use a custom ArrayAdapter to instantiate the VideoViews. After running this I get all kinds of errors, such as:

  • E/MediaPlayer﹕ error (100, 0)
  • E/AndroidRuntime﹕ FATAL EXCEPTION: main java.lang.IllegalStateException at android.media.MediaPlayer.prepareAsync(Native Method)
  • I/MediaPlayer﹕ path is null
  • D/MediaPlayer﹕ Couldn't open file on client side, trying server side

Upon further research I found many posts suggesting the VideoViews and ListViews do not play well together because of the way ListView recycles views. Most of these posts are quite old though (circa 2011-2013). My question is, has this issue been fixed or is it a fact that VideoViews should not be embedded within a ListView? If not, is there some other acceptable way of having a scrolling list of embedded video players?

I would have thought this was a fairly common requirement of Android apps. I'm only supporting Android 4.0+. Cheers

Fortress answered 11/8, 2014 at 4:4 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.