Re: MPMoviePlayerController setContentURL twice
Re: MPMoviePlayerController setContentURL twice
- Subject: Re: MPMoviePlayerController setContentURL twice
- From: Matt Neuburg <email@hidden>
- Date: Mon, 21 Mar 2011 20:47:50 -0700
On Mon, 21 Mar 2011 16:04:52 -0500, Heath Borders <email@hidden> said:
>I create an embedded MPMoviePlayerController thusly inside my loadView method:
>
>self.moviePlayerController = [[[MPMoviePlayerController alloc] init]
>autorelease];
>
>// add to view, setup moviePlayerController's view frame, etc
>
>And I can later load a movie the user chooses thusly:
>
>NSURL *fileUrl = ...
>self.moviePlayerController.contentURL = fileUrl;
>
>and everything works great.
>
>
>However, if I set the contentURL again:
>
>NSURL *fileUrl2 = ...
>self.moviePlayerController.contentURL = fileUrl2;
>
>This does not work, even if fileUrl2 == fileUrl1.
>
>When I change the contentURL, I get the following playbackState and loadState:
>
>After first setContentURL:
>loadState == playable | playthroughOK
>playbackState == playing
>
>After my second setContentURL:
>playbackState == stopped
>loadState == unknown
>
>I can of course create a new MPMoviePlayerController for every movie,
>but I want to make sure this issue isn't indicative of a larger
>problem.
You shouldn't have to create a new MPMoviePlayerController. Setting the contentURL to a different URL works fine. Something else must be going on at your end. As always, my advice is: make a new project, reduce this to the absolute simplest possible case (an MPMoviePlayerController, its view, two embedded movies, and two buttons) and convince yourself. m.
--
matt neuburg, phd = email@hidden, <http://www.apeth.net/matt/>
A fool + a tool + an autorelease pool = cool!
Programming iOS 4!
http://www.apeth.net/matt/default.html#iosbook_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden