1
votes

I am developing an iPhone application in which I play a video using MPMoviePlayerController. I use custom controls to play the video.

I have a slider that shows video time line. Using this user can seek the movie to any time-line of the movie.

When user continuously moves the slider:

  1. Pause the video only for first time; [MPMoviePlayerController-obj pause]
  2. MPMoviePlayerController-obj.currentPlaybackTime = slider.value

When slider action ends:

  1. Play the video; [MPMoviePlayerController-obj play]

This plays the movie from the position where user had left the slider. But, it leads to blank frame when movie completes playing. This defect occurs randomly; i.e not for all the seek'd time.

What is the reason for getting the blank frame? How do I solve this?

Thanks and Regards, Deepa

2
I also noticed while debugging that, if I do not set MPMoviePlayerController-obj.currentPlaybackTime when user continuously moves the slider, it works fine. But, I want to do that because user needs to view the frame when he set the time-line by moving the slider.spd
Also, when the movie completes playing (MPMoviePlayerPlaybackDidFinishNotification), the currentPlaybackTime of the MPmoviePlayerController is 0 if the problem exists; otherwise it is equal to duration of the movie. Could someone help me please?spd

2 Answers

2
votes

I'm not sure if this will work, but try setting the initialPlaybackTime to either the slider.value or to currentPlaybackTime.

2
votes

For being sure that your content is not flawed, hence possibly triggering that issue, you should try to replicate your faulty MPMoviePlayerController results using Apple's reference video content.

I have personally observed many issues in connection with improper encoding. Weird things tend to happen when working with lossy compressed content. This is true for video (i-frames vs. p-frames) as well as audio (variable bitrate).

One being improper playback durations being reported. Such issue may result into an unexpected finished-state. I have seen cases where MPMoviePlayerController still shows a bunch of seconds to play even though the actual video has obviously finished. Those cases occur frequently once the user seeks around within the video.

Once you made sure that the issue occurs using the given sample files as well, you should file a bug-report.