openfrog
openfrog

Reputation: 40755

How to start movie playback at a certain frame or position in time, using MPMoviePlayerController?

The MPMediaPlayback protocol seems to not define any helpful method for this, and I couldn't find one in the MPMoviePlayerController. But I guess there IS a way to do it, because users must be able to drag the slider to some point in time when playing a movie.

Yesterday I was reading a blog post that claimed the MPMovieController could do exactly that. Unfortunately I didn't bookmark it...

For example, I would want to start the movie programmatically at 20 seconds.

Does anyone know how to do it?

BTW, it's non-streaming content!

Upvotes: 1

Views: 2290

Answers (2)

tc.
tc.

Reputation: 33592

If you want to restrict the playback range, set initialPlaybackTime and endPlaybackTime. Playback will automatically start at the "initial" time.

IIRC the scrubber control is slightly broken on 3.1.

Upvotes: 0

Guy Moreillon
Guy Moreillon

Reputation: 1013

There's a currentPlaybackTime property accessible in the MPMediaPlayback protocol, simply set it with the chosen position in the movie (e.g. 20.0 for 20 seconds into the movie)

Upvotes: 2

Related Questions