Elias
Elias

Reputation: 3368

Set new contentURL for MPMoviePlayerController

In my app a video is played via a MPMoviePlayerController. However it can happen that the currently played video should be replaced with a new one by setting a new contentURL.

If I do this, the current video stops and the movie player turns black. But the new video wont load. It just turns black without displaying any controls.

The moviePlayer's loadState then stays MPMovieLoadStateUnknown. I am 100% sure that the contentURL is valid, I also tried to re-set the exact same url to make sure.

I also tried [moviePlayerController prepareToPlay] after re-setting the contentURL, but that doesn't change anything.

Any ideas on this?

Thanks

Upvotes: 1

Views: 1530

Answers (1)

jwhat
jwhat

Reputation: 2042

Set the movieSourceType again, right before you set the new contentURL value.

self.player.movieSourceType = MPMovieSourceTypeUnknown;
self.player.contentURL = [NSURL URLWithString:url];

Upvotes: 5

Related Questions