avqueueplayer - How can I play movies on the toppest screen in IOS? -


i trying play movies view controller. using code below that:

videoplayerviewcontroller* movieplayer = [self.storyboard instantiateviewcontrollerwithidentifier:@"videoplayercontroller"]; movieplayer.view.frame = rect; uiwindow *window = [[[uiapplication sharedapplication] windows] lastobject]; [window.rootviewcontroller presentviewcontroller:movieplayer animated:no completion:nil]; [movieplayer playmoviesforitems:items]; 

normally works fine. sometimes, movie starts cannot see video, can hear sounds.

what best way play video on top of everything?

nsstring *path = [[nsbundle mainbundle] pathforresource:@"myvideo" oftype:@"mp4"];     mpmovieplayercontroller *myplayer = [[mpmovieplayercontroller alloc] init]; myplayer.shouldautoplay = yes; myplayer.repeatmode = mpmovierepeatmodeone; myplayer.fullscreen = yes; myplayer.moviesourcetype = mpmoviesourcetypefile; myplayer.scalingmode = mpmoviescalingmodeaspectfit; myplayer.contenturl =[nsurl fileurlwithpath:path]; [self.view addsubview:myplayer.view]; [myplayer play]; 

another solution segue viewcontroller , dissmiss when movie ends.


Comments

Popular posts from this blog

blackberry 10 - how to add multiple markers on the google map just by url? -

php - guestbook returning database data to flash -

delphi - Dynamic file type icon -