Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

seekTo in VideoView


I'm having problems with seeking video. My application should resume video from place where it was stopped last time. So I do this:

videoView.seekTo(bookmark);
videoView.start();
However when it plays I hear sounds form beginning of video for about 1-2 sec. And only after that video seeks to the right position. This behavior is reproducible on HTC Nexus One, HTC G1, HTC evo. But on Samsung galaxy tab all plays normally.

Anybody had similar problems? Is this bug HTC-specific? Thanks in advance.
like image 696
underwood Avatar asked Dec 27 '10 17:12

underwood


People also ask

What is the use of VideoView in Android?

Displays a video file. The VideoView class can load images from various sources (such as resources or content providers), takes care of computing its measurement from the video so that it can be used in any layout manager, and provides various display options such as scaling and tinting.


1 Answers

It is definitely not specific to your phone. I am having the same issue on an HTC Incredible. The seekTo works but there is an audio glitch from the beginning of the clip. Based on the results trying to implement the custom VideoView I guess I won't go to the trouble. I am now going to see if I can mute the very beginning of the clip. I'll report back here if I succeed.

Well, I have given up on this. The only way I have found to mute the beginning of the clip is to mute the phone entirely, which would mute the background music as well. I will assume that this will be fixed sometime in the future since this is a known issue:

http://code.google.com/p/android/issues/detail?id=9135 Issue 9135: MediaPlayer/VideoView and SeekTo before initial playback starts from beginning for few millisecs

like image 153
charles young Avatar answered Sep 26 '22 11:09

charles young