Strange behaviour with setCurrentPlaybackTime

Viewed 595

I use: MPMoviePlayerController to show video.

Below I put list of thumbs from the video. When pressing a thumb I want to jump to a specific place in the video using: setCurrentPlaybackTime.

I also have a timer updating the selected thumb according to the location of the video using: currentPlaybackTime.

My problem: when calling: setCurrentPlaybackTime, the player keeps giving the seconds before seeking to the specific second. It take few seconds to the player to reflect the new seconds. In the mean time the experience of the user is bad: Pressing a thumb shows it selected for a show time, then the timer updates to the previous thumb, then it jumps back to the thumb I selected.

I tried using (in the timer):

if (moviePlayer.playbackState != MPMoviePlaybackStatePlaying && !(moviePlayer.loadState & MPMovieLoadStatePlaythroughOK)) return;

In order to prevent from the timer to update the selected thumb as long the player is in a transition phase between showing the previous thumb and the new thumb, but it doesn't seem to work. The "playbackState" and "loadState" seems to be totally inconstant and unpredictable.

1 Answers
Related