Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7896033
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T07:47:22+00:00 2026-06-03T07:47:22+00:00

I am having issues getting an embedded video file to play using MPMoviePlayerController. My

  • 0

I am having issues getting an embedded video file to play using MPMoviePlayerController. My code:

 NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *documentsDirectoryPath = [paths objectAtIndex:0];

NSString *proud = [[documentsDirectoryPath stringByAppendingPathComponent:@"archives"] stringByAppendingPathComponent:selectedCountry];

NSString *content = [proud stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];    
NSURL *url = [[NSURL fileURLWithPath:content] retain];   

NSLog(@"%@", url);
player =

[[MPMoviePlayerController alloc] initWithContentURL: url];

[player prepareToPlay];

player.allowsAirPlay = YES;
player.scalingMode = MPMovieScalingModeAspectFit;

player.view.frame = self.view.frame;

[self.view addSubview: player.view];
[player setFullscreen:YES animated:YES];

// ...

[[NSNotificationCenter defaultCenter] 
 addObserver:self
 selector:@selector(movieFinishedCallback:)
 name:MPMoviePlayerPlaybackDidFinishNotification
 object:player];

[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(exitedFullscreen:) name:MPMoviePlayerDidExitFullscreenNotification object:player];


[[NSNotificationCenter defaultCenter] addObserver:self
                                         selector:@selector(moviePlayerWillExitFullscreen:)
                                             name:MPMoviePlayerWillExitFullscreenNotification
                                           object:player];


[player play];

The NSLog returns

var/mobile/Applications/EF62B00B-2906-435C-BC84-036FE14D89E9/Documents/archives/Test%2520-%2520Daddy%2520May%25201%252001:26:35%2520PM.mp4

But the video never plays, though MovieDone does get triggered from the log I use in MPMoviePlayerController MovieFinished Callback. Any thoughts?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T07:47:23+00:00Added an answer on June 3, 2026 at 7:47 am

    i think you play only video file then try this code :

    NSString *urlStr=[[NSBundle mainBundle]pathForResource:@"Video1VoiceOver.mp4" ofType:nil];
    NSURL *url = [NSURL fileURLWithPath:urlStr];
    moviePlayer = [[MPMoviePlayerController alloc] initWithContentURL:url];
    [self.view addSubview:moviePlayer.view];
    moviePlayer.view.frame = CGRectMake(174,154,720,428);  
    [moviePlayer play];
    
    
    
    
    [[NSNotificationCenter defaultCenter] addObserver:self 
                                             selector:@selector(moviePlayBackDidFinish) 
                                                 name:MPMoviePlayerPlaybackDidFinishNotification 
                                               object:nil];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am having issues getting the -e and -d file test operators to work
I'm having some issues with getting cookies to work when using a ProxyPass to
I'm working with some OpenGL code for scientific visualization and I'm having issues getting
I'm having issues getting the customer.xml layout file to work properly for the customer's
I'm having issues getting jQuery tooltips (using Tipsy) to work. The tooltips work fine
Im having issues getting below code to convert to query and work: The original
Having issues getting links that match a given word to display using Xpath and
I'm having issues getting a php form to write to a file hosted with
I am having issues getting my database to build from my YAML file. Here
I am having issues getting this piece of code to compile. I am compiling

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.