MPMoviePlayerController only playing audio *when played again*

Hi guys,
I'm using MPMoviePlayerController to play back a movie file called Move.m4v (extracted from Apple's own "MoviePlayer" sample project). It plays back just fine when I call the play function, but if I exit the player and try to play it again, I only get audio. There's no video and none of the controls show up either!
I tried playing the "MoviePlayer" sample again. It shows fine the first time around, but if you play it again, it becomes all flickery!
Does anyone please have a solution for this, or has seen it before?
Thanks a lot
Here's the code I'm using to play the movie. The playVideo function gets called by a button on the UI:
#import "HomeViewController.h"
@implementation HomeViewController
@synthesize playVideoButton;
@synthesize mMoviePlayer;
- (IBAction) playVideo{
NSLog(@"calling playVideo");
mMoviePlayer = [[MPMoviePlayerController alloc] initWithContentURL:[self movieURL]];
[mMoviePlayer play];
- (NSURL *)movieURL
NSURL *mMovieURL = nil;
NSBundle *bundle = [NSBundle mainBundle];
NSString *moviePath = [bundle pathForResource:@"Movie" ofType:@"m4v"];
mMovieURL = [NSURL fileURLWithPath:moviePath];
return mMovieURL;
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceO rientation {
// Return YES for supported orientations
return YES;
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning]; // Releases the view if it doesn't have a superview
// Low on memory: Release anything that's not essential, such as cached data, or perhaps
// unload the movie, etc.
- (void)dealloc {
[super dealloc];
// free our movie player
[mMoviePlayer release];
@end

I found that if you release the instance in a 'moviePlayBackDidFinish' that sometimes this can cause an error (almost as if the instance is still required). The way I do it is to release the instance right before you call it again:
#import "HomeViewController.h"
@implementation HomeViewController
@synthesize playVideoButton;
@synthesize mMoviePlayer;
(IBAction) playVideo{
NSLog(@"calling playVideo");
// add these lines to release the previous instance
if (mMoviePlayer != nil) {
// free the old movie player
[mMoviePlayer release];
mMoviePlayer = [[MPMoviePlayerController alloc] initWithContentURL:[self movieURL]];
[mMoviePlayer play];
(NSURL *)movieURL
NSURL *mMovieURL = nil;
NSBundle *bundle = [NSBundle mainBundle];
NSString *moviePath = [bundle pathForResource:@"Movie" ofType:@"m4v"];
mMovieURL = [NSURL fileURLWithPath:moviePath];
return mMovieURL;
(BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
// Return YES for supported orientations
return YES;
(void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning]; // Releases the view if it doesn't have a superview
// Low on memory: Release anything that's not essential, such as cached data, or perhaps
// unload the movie, etc.
(void)dealloc {
// free our movie player
[mMoviePlayer release];
[super dealloc];
@end

Similar Messages

  • Can only get audio when trying to AirPlay from Dish app

    Since updating to IOS 6 I only get audio when air playing from my Dish Network app on my iPad.  I can get audio and video when mirroring; however the quality is horrible and it doesn't fill my screen.  I was able to get audio and video both before updating my iPad and Apple TV.  The recent updates have been a disaster!! 
    Apple TV and AirPlay were  great products before. I thought updates are supposed to make Apple products better....not worse. Please help if there is a solution

    Usually these types of limitations are added by the app developer, especially with media apps like these. However I would first try Resetting the devices. I found the best way to reset the iPad is to close all apps in the recently used app list. Double tap the Home button to reveal the list at the bottom then tap and hold one icon till they wiggle and display a minus button. Tap the to close all apps them press the Home button to get back to the home screen. Hold the Sleep button till "Slide to power off" appears. Once it has shut down completely press the Sleep button till you see the Apple icon.
    The procedure is similar to resarting your computer when it starts acting flaky. iPads are just a hand head computer and rarely gets shut down or reset so it would be similar to running your computer for months at a time without shutting it down.

  • HT201335 I can only get audio when using airplay through sky go on my apple tv on iphone 4

    I cn only get audio when using airplay through sky go on my apple tv on iphone4. Any ideas?

    Sky go is an app that does not support video AirPlay, not all apps do.

  • FCP Video files burn to DVD, Only gets audio when played

    Hi,
    I know this has been asked many times, but, it's late at night and I'm looking for a quick answer please.
    I burnt ideo clips,which I have exported thru FCP, and burn them straight onto a DVD thru the Finder.
    The person who got the DVD said he only gets audio from the clips, so, he can't see them.
    Have many ideas of what I should do, but, what is the most common solution to this problem?

    #48 - Cannot view DVCPRO HD or HDV or ProRes on my computer.
    Shane's Stock Answer #48 - Cannot view DVCPRO HD, HDV or ProRes QT files on your computer.
    The DVCPRO HD, HDV and ProRes codecs only comes with FCP. If your computer does not have FCP installed, it cannot view these quicktime files. It doesn't matter if it is a Mac or PC, without FCP installed, you cannot view these files.
    If you need to view ProRes material, you can download the ProRes decoder (mac and windows compatible) for ProRes
    http://support.apple.com/downloads/AppleProRes_QuickTime_Decoder_1_0_forWindows.
    http://support.apple.com/downloads/AppleProRes_QuickTime_Decoder_1_0_forMac
    If your footage was captured as DVCRO HD you can buy the Calibrated DVCPRO HD decoder:
    http://www.calibratedsoftware.com/QDVCProHD.asp
    HDV, XDCAM? Calibrated has you covered too:
    http://www.calibratedsoftware.com/QXD.asp
    If you have MXF files from a P2 camera and you need to view the footage on a computer without FCP, you can download P2CMS from Panasonic:
    http://www.panasonic.com/business/provideo/p2-hd/downloads-and-updates.asp
    Or you need the other party to compress the footage into a format your computer can play, like H.264.
    Shane

  • I only get audio when I try to play a MPEG file

    When I try to play a movie I get a green screen with audio and no video.

    I just answered this same question in another thread - [here|http://discussions.apple.com/thread.jspa?messageID=6696184#6696184].

  • Premiere only shows audio when importing a .wmv file

    I have a 30 sec spot that is a .wmv file. It plays normally in Windows Media Player, plays normally in Bridge, but when I import it into Premiere CS6, it shows it in the project file as a .wmv, but when I pull it onto the timeline or put it into the source window, all I see is an audio file.  What happened to the video? Why won't it import also, I know it's there because it plays outside of Premiere just fine. PPro is supposed to import wmv files but where's the video?

    Buy the latest version of Nero, import the problem file to a DVD or Blu-Ray project then use the Export function. I have been amazed many times how many file types I cannot import to Premiere or Media Encoder that Nero can import and convert to something Premiere can work with.
    Just yesterday I was given a 720P wmv file where Premiere gave me a perpetual "Media Pending" image for the video. Media Encoder likewise gave me a "Rendering" message that lasted forever. Nero allowed me to import the file then export as an AVCHD file with the m2ts extension which Premiere can handle.
    Are you listening Adobe?
    BB

  • Sharing to quicktime then only get audio when on a PC (Windows)

    I shared my iMovie as a quicktme format. It plays normally on my mac, but not on a PC

    'quicktime' is no format, aka codec..
    audio-only implies, you're choice was h264, which needs QT vers. 7 to offer video too ... check the version on the Windows machine ..

  • I only get audio when i render a clip In fianl cut

    Is it possible that a video mp4 need sto be converted to another format?
    also is'nt there a way to view your clips on the time line without rendering???

    Yes, convert the clip to either DV or Apple Intermediate Codec.
    Make sure the converted clips match the properties on an FCE Easy Setup.
    We would need to know the properties of the existing clips to advise further.
    Al

  • Only play the audio part of my H.264, mp4 Video??

    Hey guys,
         Im currently running Lion (10.7.3) on my macbook pro, but i also have windows bootcamped on here as well. I was doing a bit of gaming on the windows side and i used a program called "Fraps" to record some of my gameplay, and i then wanted to edit it with iMovie '11. Fraps uses its own codec, and its a .avi file nativly. I used a program called "VidCoder" to convert the Fraps codec .avi video to a H.264 codec mp4 video, so that way i could (theoretically) import it into iMovie. BUT ALAS!!! its not working...the veryyyy strang part of this is that i have done this before, and it has had no problems. In fact, i still have the clips on here from last time, and i am able to play them just fine. I used the EXACT same program to encode, with the EXACT same settings. I cant only hear audio when using quicktime, and iMovie wont even let me import them. Any help on this would be great!!! Feel free to let me know if i've been to vauge, or if you need more info.
    Thanks,
    Aaron
    PS. Heres a shot of the vid i cant get to work, and the one from a while ago that works just fine.

    Im not a pro, so alot of that in jibberish to me, but i did try encoding it with a lower bit rate (around 10,000 i think) and it successfully played via QT. what is the difference between a 79,000 bitrate and a 10,000 bitrate??
    Basically, the Profile and Level define the combination of settings/limitations that adhere to a particular "standard." As previously mentioned, Main Profile Level 3.1 is very common for Apple software and hardware products which appear to come close to the settings for your "working" file. This combination for instance would allow data rates up to 14 Mbps (14,000 Kbps) with 1280x720 @ 30.0 fps while a Main Profile Level 3.2 file would allow a data rates up to 20 Mbps (20,000 Kbps) with 1280x1024 @ 42.2 fps. From this and the fact that your stats did not include the frame rate and/or whether or not the file was encoded anamorphically, I "guestimated" that you might have a "standards" issue in the Level 3.1 to Level 3.2 range for any Baseline, Extended, Main, or High Profile H.264 encode. Your results for the re-encoded file seem to confirm that the data rate was the problem here—i.e., that the video data rate at 80 Mbps was beyond the range of the Profile and Level designation for the file while 10 Mbps was not. Your ability to encode using non-standard settings is one of the reasons that Apple has moved more and more toward the use of device "presets" which prevent novice users from making such relatively simple mistakes when creating files in any of the QT based apps.  Hope this helps you to understand the problem better.

  • No audio when with second monitor attached and using Extend, Duplicate,​or Second Screen Only modes

    When I attached a second monitor via HDMI cable and try to use Duplicate, Extend, or Second Screen only display modes, I can get the video to display and run but I get no audio unless I set the notebook display settings to P/C Only mode.  I really want to use the second screen for PowerPoint/Presenter View and play a embedded video (along with the sound).  Even if I try to play a YouTube video I can only get audio when in P/C Screen Only mode.  Any assistance would be greatly appreciated.  Thank you.
    This question was solved.
    View Solution.

    Hi,
    Please disable HDMI sound to force audio back to the laptop or use different conection such as VGA or DVI. To diable HDMI sound, please right click speaker icon > playback devices > right click and disable HDMI sound.
    Regards.
    BH
    **Click the KUDOS thumb up on the left to say 'Thanks'**
    Make it easier for other people to find solutions by marking a Reply 'Accept as Solution' if it solves your problem.

  • When I drag the imported video files to the time-line it only recognizes audio - would anyone know why?

    This happened 2 days ago. Before everything was working normal. Since yesterday each time I import a video and drag it to the time line, it only allows me the drag the audio portion of the file. Even those files which I uploaded several days earlier and
    worked perfectly fine - now even those files are only showing audio when dragged to the timeline. I hope I didn't make my question too confusing.
    I have adobe premier PRO CC 2014 and I bought it vie creative cloud.
    Would anyone know why is this happening all of the sudden?

    More information needed for someone to help... please click below and provide the requested information
    -Premiere Pro Video Editing Information FAQ http://forums.adobe.com/message/4200840
    •What is your exact brand/model graphics adapter (ATI or nVidia or ???)
    •What is your exact graphics adapter driver version?
    •Have you gone to the vendor web site to check for a newer driver?
    •For Windows, do NOT rely on Windows Update to have current driver information
    •-you need to go direct to the vendor web site and check updates for yourself
    •ATI Driver Autodetect http://support.amd.com/en-us/download/auto-detect-tool
    •nVidia Driver Downloads http://www.nvidia.com/Download/index.aspx?lang=en-us

  • Why does quicktime only export audio

    Why does Quicktime only export audio when exporting .mov files? I used to do it all the time with this same version. Now it doesn't work. I see a lot of other posts asking the same question and no answers.

    Why does Quicktime only export audio when exporting .mov files? I used to do it all the time with this same version. Now it doesn't work. I see a lot of other posts asking the same question and no answers.
    MOV files are audio and/or video content wrapped in an MOV file container. The first step in solving your problem would be to determine what codec components were used to create the source files and then determine if they are still supported by you current system configutation and/or conversion work flow.

  • I purchased a song off of itunes and it said it downloaded successfuI but when i go to listen to that song it only plays 2 seconds of the song and i cant figure out how to download it again. What can i do.

    I purchased a song off of itunes and it said it downloaded successfully, but when i try to listen to that song it only plays 2 seconds of that song and i cant figure out how to download that song again. What can i do.

    Delete it, click here, and follow the instructions.
    (88741)

  • Imported video from imovie, when i try to play only have audio, screen is red and flickering

    imported video from imovie, when i try to play only have audio, screen is red and flickering.  new mac pro.

    steved
    Thanks for the reply with additional details.
    In order to help you with the Elements Organizer 13 and Premiere Elements 13 issues, we need details of that video from iMovie.
    You should be able to get the important details of the iMovie video by telling us the export settings that you used for the iMovie export.
    Minimum information..
    Video Compression
    Audio Compression
    File Extension
    Frame Size
    First, update Premiere Elements 13 and Elements Organizer 13 each to the 13.1 Update (See Help Menu/Update in an opened
    Premiere Elements 13 project.)
    We will be watching for further details in order to plan and carry out troubleshooting strategy.
    Thank you.
    ATR.

  • HT5517 When im doing an airplay how come only audio no video on the TV? and its showing to my iphone this device can only play sounds to airplay!

    When i'm doing airplay ther is no video only audio! and from my iphone its say this device can only play sound to airplay!!!

    what video are you trying to stream via airplay?
    currently only video from youtube app or ipod app is supported.
    any other app will only stream the audio.

Maybe you are looking for

  • Compress audio file to mp3 or aiff of 5 MB?

    Hello, Does anyone know if I cam compress an audio file on GarageBand for the iPad 2? I'd like to take a file 30 minutes in length and be able to email it, so I need to compress it to 5 MB or less.

  • Flash Slide  presentation and movieclip looping

    Hi, Im having a problem with the flash slide presentation. I have on the main timeline of one of my slides a movieclip. When i play the movie, the clip will loop endlessley. I would like the movie clip to play just once. In a regular flash movie this

  • Duplicate rows returned by contex index

    Hi I have a context index - locally partitioned with concatenated datastore. When I run a query on this it gives me duplicate rows (But for some rare cases only). Is this a bug in Oracle text? The table is partitioned on column norm_state_query - Thi

  • TDE failed with ORA-03113 on 11.2.0.3

    Database version is 11.2.0.3 enterprise, OS is oracle enterprise linux 5.8 When trying to encrypt a column throw error SQL> alter table accounts modify acct_number encrypt; alter table accounts modify acct_number encrypt ERROR at line 1: ORA-03113: e

  • Cannot Create a ReportDocument Class on Win 7/VS 2008/Crystal 2008

    I recently installed Crystal 2008 (CR Developer) on my Win7/64bit dev. PC, then switched all .NET crystal references from v10 to v12. When I try to run a simple project containing a single report and crystal viewer, I am unable to create a ReportDocu