iphone - how to add video to app -


I'm trying to create an app that plays a video, and I have problems I heard the sound but no video I have honestly tried to look around for a solution, but all suggestions do not seem to work. Here's the code:

Videotest vicca controller. M
  #import "Videotest VIPU Controller." @ Implementation videotest to create a visual hierarchy for VIPU controller // program, - (zero) load view {NSString * moviePath = [[[NSBundle main bundle] resourcepath] stringbapping path companion: @ "Spitfiregril_iphone.m4v"]; MPMoviePlayerController * TheMovie = [[MPMoviePlayerController alloc] initWithContentURL: [NSUr File URLWithPath: MoviePath]]; TheMovie.controlStyle = MPVM Control Style Default; [[NSNotificationCenter defaultCenter] addObserver: Self Selector: @Selector (Movie Fixed Callback) Name: MPMVplayerplaybackDefinition Object: Movie]; [Movie play]; } / * // Implement viewDidload to make additional setup after loading the view, especially with a nibb. - (zero) viewDidoadload [[Super Viewedload]; } * / / * // Override to allow the orientation other than the default portrait orientation - (BOOL) should be metaAutotettoInterface orientation: (UINPreference Orientation) Interface Orientation {// Return Yes, Supported Orientation Returns (Interface Orientation == UINEfterformation Portrait); } * / - (zero) Resize memory warning {// See if there is no supervisor then it releases it. [Super dareceywamari warning]; // Use any cached data, images, etc. which are not in use. } - (zero) viewDidUnload {// Release main view of any maintained subviews // eg. Self.myOutlet = Zero; } - (zero) Delok [[Super Delooc]]; } @end   

Videotest Visa Controller

  #import & lt; UIKit / UIKit.h & gt; #import & lt; Media Player / Media Player H & gt; @ Interface video editor: UIViewController {} @end    

  - (zero) ViewDidload {NSString * url = [[NSBundle main bundle] pathForResource: @ "Stock_Footage_Demobroadband" type: @ "MP4"]; MPMoviePlayerController * Player = [[MP3 MPV Player Controller Light] initWithContentURL: [NSUr file URLWithPath: url]]; [[NSNotificationCenter defaultCenter] addObserver: Self Selector: @Sylector (Filmmaker Callback :) Name: MPMPplayerplaybackDefinition Object: Player]; // --- Play partial screen --- player.view.fr = CGRactack (184, 200, 400, 300); [Self.view addSubview: player.view]; // --- Play Movie --- [Player Play]; [Super viewedload]; } - (zero) movie fixed callback: (nsnification) * an information {mpvpplayer controller * player = [an information object]; [[NSNotificationCenter defaultCenter] Deletion Observer: Own Name: MPMVplayerplaybackDefinition Object: Player]; [Player stops]; [Self.view removeFromSuperView]; [Player autorquez]; }   

Video in full screen mode -

  - (zero) viewDidoad {NSString * url = [[NSBundle main bundle] pathForResource: @ "Stock_Footage_Demobroadband" Type: @ "mp4"]; MPMoviePlayerViewController * playerViewController = [[MP3 MPV PlayerView controller] initWithContentURL: [NSUr File URLWithPath: url]]; [[NSNotificationCenter defaultCenter] AddObserver: Self Selector: @Selector (Movie Fixed Callback) Name: MP3 MPV Player Playback Diffinfish Information Item: [PlayerView Controller Movieplayer]]; [Self.view addSubview: playerViewController.view]; // --- Play Movie --- MP3 MPV Player Controller * Player = [PlayerView Controller Movie Player]; [Player's game]; [Super viewedload]; } - (zero) movie fixed callback: (nsnification) * an information {mpvpplayer controller * player = [an information object]; [[NSNotificationCenter defaultCenter] Deletion Observer: Own Name: MPMVplayerplaybackDefinition Object: Player]; [Player stops]; [Self.view removeFromSuperView]; [Player autorquez]; }    

Comments