Closed ghost closed 13 years ago
Just add
@interface ParseOperation : NSOperation
Um, Github stripped that out. It should be [...] NSOperation lessthansymbol NSXMLParserDelegate greaterthansymbol {
Thanks that got it. Now how do we use MPMoviePlayerController and MPMoviePlayerViewController I guess Apple changed the API but I can't for the life of me figure out how to implement the viewcontroller into it now.
Are you sure podcasts don't play anymore? I think they may just play in the background. Wait around and you may hear some audio. Still not ideal and requiring a fix, but I think it does work.
The solution is to use a MPMoviePlayerViewController. Notice the View part. Then you can show the movie with [self presentMoviePlayerViewControllerAnimated:theMovie]; You can also release it right away I think, no need for the observer stuff, since the modal view should retain it. Haven't run into any problems doing it this way.
ah ok, I will try that. Thx a ton.
Could you explain where to put the new MP code? I am in MediaViewController.m looking at
-(void) playMovieAtURL: (NSURL*) theURL {
MPMoviePlayerController* theMovie =
[[MPMoviePlayerController alloc] initWithContentURL: theURL];
theMovie.scalingMode = MPMovieScalingModeAspectFill;
//theMovie.movieControlMode = MPMovieControlModeHidden;
// Register for the playback finished notification
[[NSNotificationCenter defaultCenter]
addObserver: self
selector: @selector(myMovieFinishedCallback:)
name: MPMoviePlayerPlaybackDidFinishNotification
object: theMovie];
// Movie playback is asynchronous, so this method returns immediately.
[theMovie play];
}
But can't seem to figure out how to change the MP so that it actually works without errors.
Try this:
- (IBAction)playMedia:(id)sender {
MPMoviePlayerViewController* theMovie =
[[MPMoviePlayerViewController alloc] initWithContentURL: [NSURL URLWithString: self.item.enclosureURLString]];
theMovie.moviePlayer.scalingMode = MPMovieScalingModeAspectFit;
// theMovie.movieControlMode = MPMovieControlModeHidden;
theMovie.moviePlayer.controlStyle = MPMovieControlStyleFullscreen;
// Movie playback is asynchronous, so this method returns immediately.
[self presentMoviePlayerViewControllerAnimated:theMovie];
[theMovie.moviePlayer play];
[theMovie release];
}
This is modified code, so adjust as needed.
I am getting an error on the
[NSURL URLWithString: self.item.enclosureURLString]];
it is saying "Request for member "item" in something not a structure or union"
Is that the part you were saying would need to modified as needed? Sorry for the beginner questions.
Yes, it's modified :) I called it item. You should probably change:
MPMoviePlayerViewController* theMovie =
[[MPMoviePlayerViewController alloc] initWithContentURL: [NSURL URLWithString: self.item.enclosureURLString]];
to
MPMoviePlayerViewController* theMovie =
[[MPMoviePlayerViewController alloc] initWithContentURL: theURL];
ah ok, thank ya kindly.
That worked to get rid of errors but the movies still will not play when I press the "video" button inside the app running on the simulator. Any thoughts?
Bamm, nm it works all to well.
I needed to change the code in a couple different places for it to work. Thanks so much.
I'm getting a 'theURL is undeclared' error when I try to build. Any ideas? I've implemented the code suggested above in the 3 controller .m files.
Notice above my method is completely different than the one in communique. theURL comes from the method declaration, so as long as that's the same, you should have it.
I just did a commit that includes the new 3.2 API for video playback. Merge the latest commit and it should fix the issue.
I keep getting the warning for this: class 'ParseOperation' does not implement the 'NSXMLParserDelegate' protocol
Also the video link isnt working now on mine. Anyone else having the same prob?