Reputation: 1445
I am developing an iPhone application in which I play videos using MPMoviePlayerController
.
Sometimes, some of the videos don't play immediately after I call play on MPMoviePlayerController
.
I have called prepareToPlay and in the notified method of MPMediaPlaybackIsPreparedToPlayDidChangeNotification
, I am calling play on MPMoviePlayerController
.
Could someone help in identifying the problem here?
Thanks, Laxmilal
Upvotes: 3
Views: 1185
Reputation: 27597
From my answer in a similar thread (reducing-the-initial-delay-when-playing-remote-video-content) - Note this fragment of the solution is valid for both, remote and local video content.
Use theMPMoviePlayerController.movieSourceType
property when initializing your
player to cut down the media
recognition delay.
From the MPMoviePlayerController Class Reference:
The default value of this property is MPMovieSourceTypeUnknown. This property provides a clue to the playback system as to how it should download and buffer the movie content. If you know the source type of the movie, setting the value of this property before playback begins can improve the load times for the movie content. If you do not set the source type explicitly before playback, the movie player controller must gather this information, which might delay playback.
Upvotes: 1