Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Mockup & CodeGen, iPhone & iPad
($9.99)

Make your own iPhone apps
and run them live!
(free)

Manu
($0.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum > iPhone SDK Development Forums > iPhone SDK Development

Reply
 
LinkBack Thread Tools Display Modes
Old 08-13-2008, 12:46 PM   #1 (permalink)
Tucker R
 
Join Date: Jul 2008
Location: Colorado
Age: 6
Posts: 4
Default MPMoviePlayerController vs. UIMoviePlayerController?

Hi Guys,

I am having some small troubles with MPMoviePlayerController. In my searches online I see that there is something called UIMoviePlayerController. Is that the official class to use for playing movies on the iPhone? Or did MPMoviePlayerController supplant UIMoviePlayerController?

The reason I ask is that I can only play a movie once. If the User hits the 'done' button, the next movie to be played is not played (it looks as though the movie will play, but then I just get a blank screen). I saw in some forums that this can be solved by calling

[theUIMovieController unlockMoviePlaybackResources]

but there is no such thing as a UIMoviePlayerController in my iPhone documentation, and the Movie sample uses MPMoviePlayerController.

I'm confused.

Thanks for any help you can provide?
troth is offline   Reply With Quote
Old 08-27-2008, 12:55 PM   #2 (permalink)
New Member
 
Join Date: Aug 2008
Posts: 9
Default Answer

UIMoviePlayerController most likely references the controls that are optionaly displayed over your movie player. MPMoviePlayerController is indeed the class you wish to use.

Last edited by jslama; 11-06-2008 at 12:49 AM.
jslama is offline   Reply With Quote
Old 09-27-2008, 03:27 AM   #3 (permalink)
New Member
 
Join Date: Sep 2008
Posts: 17
Default

Hi

How did you play the video file. i tried to play the mp4 file. but it is crashing. do you have any idea?

thanks
iPhoneQuery is offline   Reply With Quote
Old 09-27-2008, 09:23 AM   #4 (permalink)
New Member
 
Join Date: Aug 2008
Posts: 9
Default

Make sure it is the right format of video. Check more than the extension

Last edited by jslama; 11-06-2008 at 12:50 AM.
jslama is offline   Reply With Quote
Old 09-27-2008, 11:22 AM   #5 (permalink)
Registered Member
 
Join Date: Aug 2008
Posts: 80
Default

how about displaying the video on an external screen (ie sending it out via the AV cable)? which of these frameworks do that?
ecume is offline   Reply With Quote
Old 09-27-2008, 02:44 PM   #6 (permalink)
New Member
 
Join Date: Aug 2008
Posts: 9
Default

That is not done through software. You just really need the right cables. A quick search revealed this as a possible accessory but I cannot confirm if they work as advertised

[url="http://http://www.bargaincell.com/product_44524_3440.html"]
jslama is offline   Reply With Quote
Old 09-29-2008, 10:17 AM   #7 (permalink)
Registered Member
 
Join Date: Aug 2008
Posts: 80
Default

I actually have the right cable from Apple. Playing movies through the iTunes interface on the iPhone works fine. But it does not simply mirror whatever is on the screen - and I can't get anything I do in my own apps to appear on the 'second' screen (ie through the AV cable)
ecume is offline   Reply With Quote
Old 09-30-2008, 12:31 AM   #8 (permalink)
New Member
 
Join Date: Sep 2008
Posts: 17
Default

when i play video file am hearing only audio..but the video display is not coming...do u have any idea why it is happening like that...am playing mp4 file.

thanks in advance
iPhoneQuery is offline   Reply With Quote
Old 09-30-2008, 02:53 PM   #9 (permalink)
Registered Member
 
Join Date: Aug 2008
Posts: 80
Default

N.B., another issue with MPMoviePlayerController is that it seems to be a singleton instance. Loading a bunch and putting them into an NSDictionary (for instance to cache the headers for instant playback later) does not work. You only ever get the first one to play...
ecume is offline   Reply With Quote
Old 10-02-2008, 09:01 PM   #10 (permalink)
New Member
 
Join Date: Aug 2008
Posts: 9
Default

I actually know exactly whats going on with your video player because I had the same problem. If you cannot see it and it is playing, check your code crafeully and step through it. What was happening with me is a second MPMoviePlayerController was being created but not played.. Alas your move video is playing but another empty movie player is being played over top. Anyways thats what the problem was when I did it. It may be hard to prove or to find the reason, but I strongly believe that is the issue, especially since you are getting sound and not video.
jslama is offline   Reply With Quote
Old 10-08-2008, 02:30 AM   #11 (permalink)
New Member
 
Join Date: Oct 2008
Posts: 3
Default

Throw in a

[mMoviePlayer release];

on the first line of your init to make sure the old one gets killed before starting a new one.

mMoviePlayer is what I called my MPMoviePlayerController object.

The dent in my forehead is slowly returning
thebiggins is offline   Reply With Quote
Old 02-27-2009, 07:45 PM   #12 (permalink)
New Member
 
Join Date: Feb 2009
Posts: 4
Default

Has anybody had any luck using MPMoviePlayerController to play online videos? I can play local movies just fine, but when I put the same file on a server and try to play the file using the URL to it, the playback ends as soon as it starts.

Any thoughts?
kd5feg is offline   Reply With Quote
Old 03-10-2009, 11:53 AM   #13 (permalink)
R0B
New Member
 
Join Date: Mar 2009
Posts: 3
Default

I'm having a few problems with MPMoviePlayerController myself. I'm able to play a video without any sound (.m4v compressed at H.264), but if a video does have sound it will not load in the application at all. Does MPMoviePlayerController actually support videos with sound? Or do I need to incorporate other controllers to run the audio?

I am very new to this, but I am struggling to find useful documentation on the matter.
R0B is offline   Reply With Quote
Old 03-10-2009, 12:23 PM   #14 (permalink)
New Member
 
Join Date: Feb 2009
Posts: 4
Default

Quote:
Originally Posted by R0B View Post
I'm having a few problems with MPMoviePlayerController myself. I'm able to play a video without any sound (.m4v compressed at H.264), but if a video does have sound it will not load in the application at all. Does MPMoviePlayerController actually support videos with sound? Or do I need to incorporate other controllers to run the audio?

I am very new to this, but I am struggling to find useful documentation on the matter.
I have been able to play movies with sound just fine using just MPMoviePlayerController.

The interface is so simple that it's hard to get anything wrong which is why I think that my problem has to do with a server setting of some sort.
kd5feg is offline   Reply With Quote
Old 03-10-2009, 12:50 PM   #15 (permalink)
Registered Member
 
Join Date: Jan 2009
Location: Leeds, England
Posts: 109
Default

I found that MPMoviePlayerController is VERY picky when it comes to the encoding of the file.

The best way I found to get this right was to open the movie in Quicktime and do an export for iPhone.

Then use this new exported version in your application.

I tried all sorts for days before I worked this out.
BenODwyer is offline   Reply With Quote
Old 03-10-2009, 12:56 PM   #16 (permalink)
R0B
New Member
 
Join Date: Mar 2009
Posts: 3
Default

Quote:
Originally Posted by kd5feg View Post
I have been able to play movies with sound just fine using just MPMoviePlayerController.

The interface is so simple that it's hard to get anything wrong which is why I think that my problem has to do with a server setting of some sort.
Thanks. At least I know I'm on the right track. My problem is likely due to the video files themselves then.
R0B is offline   Reply With Quote
Old 03-11-2009, 11:51 AM   #17 (permalink)
R0B
New Member
 
Join Date: Mar 2009
Posts: 3
Default

Quote:
Originally Posted by BenODwyer View Post
I found that MPMoviePlayerController is VERY picky when it comes to the encoding of the file.

The best way I found to get this right was to open the movie in Quicktime and do an export for iPhone.

Then use this new exported version in your application.

I tried all sorts for days before I worked this out.
Thanks Ben, that seems an easier way of doing it. I'm still getting the problem though, but I've learned the problem could be with the iPhone Simulator rather than the code/video. I've read it can be a bit glitchy with this sort of thing. I'll try it out on a real device when I get the chance.
R0B is offline   Reply With Quote
Old 08-04-2009, 08:30 PM   #18 (permalink)
Registered Member
 
Join Date: Aug 2009
Posts: 6
Default

I really am having problems. I want a video to be displayed after a UIButton or a UIBarButtonItem is clicked. The video i have is streaming off of my dropbox. I know everything i need on that end. I just can't figure out how to play videos with the click off a button.

I have tried so many can someone tell me what i need to write in the .h, .m and delegate if needed. I have tried to make it using many methods and they all give me errors and warnings.

Please help and email me at antman3579@aol.com
antman872 is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



» Advertisements
» Online Users: 247
14 members and 233 guests
ADY, CKAmike, Dani77, dessicant, Duncan C, HemiMG, jakerocheleau, nick.keroulis, Promo Dispenser, Punkjumper, Rudy, sacha1996, sneaky, spiderguy84
Most users ever online was 1,187, 10-11-2011 at 08:09 AM.
» Stats
Members: 158,885
Threads: 89,231
Posts: 380,768
Top Poster: BrianSlick (7,129)
Welcome to our newest member, bookesp
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 03:23 PM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0