VideoView and step-by-step playback (per frame)

I would like to play frame by frame with the video. I have it:

mVideoView.seekTo (mVideoView.getCurrentPosition () + 1);

But after that I do not see the frame until I press the play button ... I do not want this, I just want to see the next frame.

Also - can I do the same for the previous frame?

Thanks in advance.

+3
source share
2 answers

He will not seek pause. But you can always pause immediately after the search if you use SurfaceView and MediaPlayer, because VideoView does not have an onSeekComplete callback.

public void seek() {
mediaplayer.start();
mediaplayer.seekTo(mediaplayer.getCurrentPosition()+1);
}

public void onSeekComplete(MediaPlayer mp) {        
mediaplayer.pause();
}

This will search and display something. Unfortunately, you will find that this does not allow you to play in turn.

+2

MediaMetadataRetriever, , BitMap, MediaMetadataRetriever.getFrameAtTime(long timeUs). , MediaPlayer.

, .

+1

Source: https://habr.com/ru/post/1767582/


All Articles