media player - IOS MPMoviePlayerViewController Loading endlessly -


i'm working on ios app (with storyoard). have viewcontroller:

//movieviewcontroller.h  #import <uikit/uikit.h> #import <mediaplayer/mediaplayer.h>  @interface movieviewcontroller : uiviewcontroller {      mpmovieplayerviewcontroller *movieplayer;  }  @property (strong, nonatomic) mpmovieplayerviewcontroller *movieplayer; -(void) playmovie;  @end   //movieviewcontroller.m - (void)viewdidload {     [super viewdidload]; // additional setup after loading view.     [self playmovie]; }  -(void)playmovie {     nsstring *videopath = [[nsbundle mainbundle] pathforresource:@"movie"                                                       oftype:@"mov"];      movieplayer = [[mpmovieplayerviewcontroller alloc] initwithcontenturl:[nsurl                                                      fileurlwithpath:videopath]]; [self presentmovieplayerviewcontrolleranimated:movieplayer]; } 

when run see viewcontroller "loading..." takes forever. enter image description here

you should call -preparetoplay and/or -play. per mpmovieplayercontroller's documentation:

starting in ios 5.0, in order facilitate finer-grained playback control, new movie player not automatically prepared play.


Comments

Popular posts from this blog

android - getbluetoothservice() called with no bluetoothmanagercallback -

sql - ASP.NET SqlDataSource, like on SelectCommand -

ios - Undefined symbols for architecture armv7: "_OBJC_CLASS_$_SSZipArchive" -