I tried to play a local mp4 video file on my TV Box. I found a weird issue with MediaPlayer's playback speed. Here're my logs:
19:30:09.346 E/MediaPlayerManager: currentMediaPlayer's duration = 16021
19:30:09.715 E/MediaPlayerManager: setOnInfoListener - MediaPlayer.MEDIA_INFO_VIDEO_RENDERING_START
19:30:27.982 E/MediaPlayerManager: onComplete
The media duration was 16s, but it took about 18s to complete the video's playback. There's always a 2s delay before the onComplete
listener got called. Does anyone have a solution for this?
After some experiments, I found out the issue was the large SurfaceView
. If I replaced it with a TextureView
or create the SurfaceView
with smaller size, there's no extra delays.
P/s: I knew ExoPlayer, but for some specific reason, I could not use it.