ios - MPMoviePlayerController custom frame size -
i use mpmovieplayercontroller displaying video. problem don't want display video in full screen, want display in small view.
in full screen working when add line (to set video frame) doesn't work anymore.
_movieplayer.view.frame = cgrectmake(250, 150, 500, 500);
here code:
viewcontroller.h
@property (strong, nonatomic) mpmovieplayercontroller *movieplayer;
viewcontroller.m
nsurl *url = [nsurl urlwithstring: @"http://www.ebookfrenzy.com/ios_book/movie/movie.mov"]; _movieplayer = [[mpmovieplayercontroller alloc] initwithcontenturl:url]; [[nsnotificationcenter defaultcenter] addobserver:self selector:@selector(movieplaybackdidfinish:) name:mpmovieplayerplaybackdidfinishnotification object:_movieplayer]; _movieplayer.controlstyle = mpmoviecontrolstyledefault; _movieplayer.shouldautoplay = yes; [_movieplayer setscalingmode:mpmoviescalingmodefill]; _movieplayer.view.frame = cgrectmake(250, 150, 500, 500); [self.view addsubview:_movieplayer.view]; [_movieplayer setfullscreen:no animated:yes];
any ideas? or maybe mpmovieplayercontroller not right object? thanks!
skipp line [_movieplayer setscalingmode:mpmoviescalingmofefill] . line not allow show video within rectmake because has fill complete screen .
Comments
Post a Comment