iphone - MPMoviePlayerController existed black background -
make ios app.
use mpmovieplayercontroller, shows black background.
think problem can solve url, can't understand use way.
mpmovieplayercontroller background color won't stick
code this.
nsstring *path = [[nsbundle mainbundle] pathforresource:@"movie_files" oftype:@"m4v"]; nsurl *videourl = [nsurl fileurlwithpath:path]; movieplayer = [[mpmovieplayercontroller alloc] initwithcontenturl:videourl]; //setting movieplayer.scalingmode =mpmoviescalingmodeaspectfit; movieplayer.controlstyle=mpmoviecontrolstyledefault; movieplayer.shouldautoplay=no; [movieplayer.view setframe:cgrectmake(20, 20, 280, 200)]; //notification [[nsnotificationcenter defaultcenter] addobserver:self selector:@selector(movieplaybackdidfinish:) name:mpmovieplayerplaybackdidfinishnotification object:movieplayer]; //clearcolor uiview *subv =[[uiview alloc]init]; for(subv in movieplayer.backgroundview.subviews) { subv.backgroundcolor = [uicolor clearcolor]; } [movieplayer.view addsubview:subv]; [self.view addsubview:movieplayer.view]; //show white screen
please tell clear background way.
you need change to:
movieplayer.backgroundview.backgroundcolor = [uicolor clearcolor]; for(uiview *asubview in movieplayer.view.subviews) { asubview.backgroundcolor = [uicolor clearcolor]; }
Comments
Post a Comment