Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Video not playing properly withing listview in android

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.

like image 821
Mrityunjoy Mukherjee Avatar asked Dec 17 '13 11:12

Mrityunjoy Mukherjee


1 Answers

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.

like image 55
Steven Trigg Avatar answered Oct 13 '22 01:10

Steven Trigg