7

I have video views within a listview. While playing video at that time if I scroll up and down the list view, video view behaves abnormally . It seems that video views jumping up and down. Please response against this problem.

  • why don't you pause the video when the user scrolls the listview , just because its the right UX. – Prateek Dec 17 '13 at 11:46

3 Answers3

1

The video is drawn onto a SurfaceView which runs in its own thread and is not synchronized with the UI, this is why it jumps around in your list while being scrolled.

There are other answers that cover this question here and here.

A workaround is that if your videos have no sound and are not too large, you can use an AnimationDrawable and a series of images or frames from your video. Load the frames using an AsyncTask and start the animation in onPostExecute.

Community
  • 1
  • 1
Steven Trigg
  • 1,903
  • 2
  • 19
  • 22
0

You can always stop playback onScrollStateChanged.

Alex Shcherbyna
  • 301
  • 4
  • 9
0

I was stumped with this too until I found this post by Ovidiu Latcu: https://stackoverflow.com/a/6832598/3367142

In short set a transparent background for your VideoView

android:background="#0000"

Community
  • 1
  • 1