Please do not post the same thing multiple times. The board software automatically flags certain posts as needing moderator attention. This happens the most often for new users. I'm pretty sure this is made clear at the time you attempt to post. Posting the same thing over and over again just makes that many more posts the moderators have to weed through later. This makes us sad. Don't make us sad. If your post/thread doesn't appear, just wait a while. Don't post it again. If it hasn't shown up by the next day, then you can try again. I normally go through posts in the mornings, and try to check a few times throughout the day, but I'm not here 24/7. There will typically be a significant delay before posts are approved. Just be patient.
Greetings! I've recently agreed to work for a friend to try to get his iPhone app updated to be compatible with iPhone OSv4.0. I'm well-versed in C, C# and Java, so I'm making my way alright through the Objective-C code, but am starting to run out of ideas, so I figured I'd turn to the forums and see if other people were experiencing similar issues.
The app is an audiobook-style app, that showcases the services his business provides. eReader is used for the navigation, and it displays videos whose URL is resolved through a sqlite3 database. The Video Player they use extends the MPMoviePlayerController if I'm reading this correctly:
The app worked fine in OS version 3.2, however it won't work on any device running OS version 4.0. Instead of playing the videos correctly, it simply crashes the program. With a little fiddling I was able to get it to play audio form the video, with a black screen, but when I attempt to play a subsequent video, the app still crashes (SIGABRT). At first I thought it was an issue with the sqlite database, but since it is able to retrieve the audio correctly, I'm beginning to think the issue may lie in the MPMoviePlayerController. Are there any known compatibility issues in OS 4.0 that could cause this sort of behavior?
I've tried tracing it to a specific line of code, but using breakpoints only allows me to access the event handlers, which all execute and return correctly. But upon, say, clicking the "Next Video" button, the method executes correctly and returns, but once I continue execution, the program crashes.
Any suggestions? It's quite a lot of code which I'm not familiar with, and any nudges in the right direction would be greatly appreciated.
Oh, wow, excellent. I'll read that guide and start updating my code.
PS- Any idea whether this new code will be backwards compatible with versions 3.2 and earlier, or would I need to write in an if statement to determine what to do on different OS versions?
Okay, I've been wrestling with this for a while now, and I'm still having issues. I can only get it to play the audio still, despite the fact that I'm pretty sure I'm using MPMoviePlayerViewController correctly. Perhaps someone can spot what I'm doing wrong here:
Okay, I've been wrestling with this for a while now, and I'm still having issues. I can only get it to play the audio still, despite the fact that I'm pretty sure I'm using MPMoviePlayerViewController correctly. Perhaps someone can spot what I'm doing wrong here:
You don't seem to display the MPMoviePlayerViewController in the view using the addSubview method for example. You need to set it's frame and add it as a subview as you would with a UILabel. Look at the MPMoviePlayerViewController Example . MPMoviePlayerViewController Class Reference
As you can see in the link, there is also a function to display the MPMoviePlayerViewController modally
Ah, I've got it working now. I was calling the addSubview method, but I was doing it on an object that was deallocated before the method where I called the play method was invoked, so when play was called, it still wasn't set up properly. Thanks a ton!
I have a Table based application using Custom UITableViewCell's. The custom Cell has a UIButton within it for playing a movie file. At the moment I have Arrays to populate the information within each cell depending on the Indexpath. All information within the Cell is placed within cellForRowAtIndexPath and all actions are within didSelectRowAtIndexPath.
The UIButton within each cell plays a movie using the standard MoviePlayerViewController like so (other code not shown)
- (void)loadMoviePlayer
{
// Play movie from the bundle NSString *path = [[NSBundle mainBundle] pathForResource:@\"Mov2\" ofType:@\"mp4\" inDirectory:nil];
// Create custom movie player moviePlayer = [[[CustomMoviePlayerViewController alloc] initWithPath:path] autorelease];
// Show the movie player as modal [self presentModalViewController:moviePlayer animated:YES];
// Prep and play the movie [moviePlayer readyPlayer]; }
The UIButton within the CustomCell is linked to the following:
-(IBAction)playMovie {
[self loadMoviePlayer]; }
Here is an example of Audio being played within didSelectRowAtIndexPath. A Array controllers the stringWithFormat using the TabelView IndexPath. Each Cell plays a certain file...
I need to be able to do the same the the movie file actioned by the UIButton in the CustomCell. The - (void)loadMoviePlayer code will not work as an Indexpath is not defined. Have it in didSelectRowAtIndexPath still will not allow me to get the Array working.
Options in my brain right now... 1. Change the - (void)loadMoviePlayer to include the indexPath as a ref and change the pathForResource to handle the Array. 2. Change the - (void)loadMoviePlayer to include the indexPath as a ref and use an if / else statement will blocks of the MoviePlayer code to repeat the process using (indexPath.row % 2 == 0)
Recap... UITableView with CustomCell using Array to populate cell information and didSelectRowAtIndexPath need MoviePlayer which is attached to a UIButton within the CustomCell to be played depending on the IndexPath / Cell.
Your help would be gratefully appreciated. Any question please feel free to ask. Thank you in advance.
If there is no way around this and the Cells didSelectRowAtIndexPath is the only option what about this. The fact that a Audio and a Video file both need to be played depending on the users requirements, what about any of the following options and the process of avenue to achieve them?
1: UIAlertView with Options 2: Double Tap Cell 3: Two Finger Tap Cell 4: Swipe Cell
Just a note...MPMoviePlayerController and MPMoviePlayerViewController both work fine in iOS 4. MPMoviePlayerController allows you to display videos embedded in screens. You need to add the view provided by the controller as a subview to your screen to get it to display.
MPMoviePlayerViewController functions similarly but it provides a simple way to display fullscreen video.
Just a note...MPMoviePlayerController and MPMoviePlayerViewController both work fine in iOS 4. MPMoviePlayerController allows you to display videos embedded in screens. You need to add the view provided by the controller as a subview to your screen to get it to display.
MPMoviePlayerViewController functions similarly but it provides a simple way to display fullscreen video.
true. that catched my eye a few days ago. thanks for the clarification. the only methods of MPMoviePlayerController that are deprecated are: backgroundColor & movieControlMode
One method is deprecated but the difference between MPMoviePlayerController & MPMoviePlayerViewController is essentially that the latter play movie in fullscreen mode straight away. I prefer to play in view and let the user choose fullscreen mode. Therefore I use MPMoviePlayerController.
Replies
I've recently posted a How To on this topic: http://www.iphonedevsdk.com/forum/iphone-sdk-development/47868-how-play-video-ipad-fullscreen-landscape-without-controls.html
I help you, you buy my app - you help me, I buy your</f
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Disagree Dislike Like AwesomePS- Any idea whether this new code will be backwards compatible with versions 3.2 and earlier, or would I need to write in an if statement to determine what to do on different OS versions?
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Disagree Dislike Like Awesomefor earlier iOS's youll need that if statement.
I help you, you buy my app - you help me, I buy your</f
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Disagree Dislike Like AwesomeThe object which contains this method is declared with the following interface:
Any glaringly obvious things I'm doing wrong here?
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Disagree Dislike Like Awesomehttp://developer.apple.com/iphone/library/documentation/mediaplayer/reference/mpmovieplayerviewcontroller_class/reference/reference.html
As you can see in the link, there is also a function to display the MPMoviePlayerViewController modally
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Disagree Dislike Like Awesome- Spam
- Abuse
- Troll
0 • Off Topic Insightful Disagree Dislike Like Awesome- Spam
- Abuse
- Troll
0 • Off Topic Insightful Disagree Dislike Like AwesomeiOS4 - iPhone 4 & 3GS
I have a Table based application using Custom UITableViewCell's. The custom Cell has a UIButton within it for playing a movie file. At the moment I have Arrays to populate the information within each cell depending on the Indexpath. All information within the Cell is placed within cellForRowAtIndexPath and all actions are within didSelectRowAtIndexPath.
The UIButton within each cell plays a movie using the standard MoviePlayerViewController like so (other code not shown)
The UIButton within the CustomCell is linked to the following:
-(IBAction)playMovie {
[self loadMoviePlayer];
}
Here is an example of Audio being played within didSelectRowAtIndexPath. A Array controllers the stringWithFormat using the TabelView IndexPath. Each Cell plays a certain file...
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
NSUInteger row = [indexPath row]; NSString *rowTitle = [filmSound objectAtIndex:row];
NSURL *url = [NSURL fileURLWithPath:[NSString stringWithFormat:@\"%@/%@\", [[NSBundle mainBundle] resourcePath], rowTitle]]; NSError *error; AVAudioPlayer *player = [[AVAudioPlayer alloc] initWithContentsOfURL:url error:&error];
if (player != nil) { [self setTheAudio: player]; [player release], player = nil;
[self.theAudio setDelegate:self];
[self.theAudio play]; }
[tableView deselectRowAtIndexPath:indexPath animated:YES]; }
I need to be able to do the same the the movie file actioned by the UIButton in the CustomCell. The - (void)loadMoviePlayer code will not work as an Indexpath is not defined. Have it in didSelectRowAtIndexPath still will not allow me to get the Array working.
Options in my brain right now... 1. Change the - (void)loadMoviePlayer to include the indexPath as a ref and change the pathForResource to handle the Array. 2. Change the - (void)loadMoviePlayer to include the indexPath as a ref and use an if / else statement will blocks of the MoviePlayer code to repeat the process using (indexPath.row % 2 == 0)
Recap... UITableView with CustomCell using Array to populate cell information and didSelectRowAtIndexPath need MoviePlayer which is attached to a UIButton within the CustomCell to be played depending on the IndexPath / Cell.
Your help would be gratefully appreciated. Any question please feel free to ask. Thank you in advance.
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Disagree Dislike Like Awesome1: UIAlertView with Options
2: Double Tap Cell
3: Two Finger Tap Cell
4: Swipe Cell
Thoughts?
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Disagree Dislike Like AwesomeMPMoviePlayerViewController functions similarly but it provides a simple way to display fullscreen video.
Check you the Apple docs for each here:
MPMoviePlayerController Class Reference
MPMoviePlayerViewController Class Reference
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Disagree Dislike Like Awesomethe only methods of MPMoviePlayerController that are deprecated are:
backgroundColor & movieControlMode
I help you, you buy my app - you help me, I buy your</f
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Disagree Dislike Like AwesomeOne method is deprecated but the difference between MPMoviePlayerController & MPMoviePlayerViewController is essentially that the latter play movie in fullscreen mode straight away. I prefer to play in view and let the user choose fullscreen mode. Therefore I use MPMoviePlayerController.
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Disagree Dislike Like Awesome