objective c - Video view is not full screen in landscape mode iPhone -
i using code autolayout view controller , playing video in view called videoview not playing video in fullscreen.
nsarray *paths = nssearchpathfordirectoriesindomains(nsdocumentdirectory, nsuserdomainmask, yes); nsstring *documentsdirectory = [paths objectatindex:0]; nsstring *path = [documentsdirectory stringbyappendingpathcomponent:savefilename]; nsurl *url1 = [[nsurl alloc] initfileurlwithpath: path]; videoplayer = [avplayer playerwithurl:url1] ; self.avplayerlayer = [avplayerlayer playerlayerwithplayer:videoplayer]; avplayerlayer.frame = self.videoview.bounds; [self.videoview.layer addsublayer: avplayerlayer]; [videoview sethidden:no]; [self.videoplayer play];
use mpmpmovieplayerviewcontroller, mpmovieplayerviewcontroller *mpvc = [[mpmovieplayerviewcontroller alloc] initwithcontenturl:url1]; nserror *_error = nil; [[avaudiosession sharedinstance] setcategory: avaudiosessioncategoryplayback error: &_error]; [self presentmovieplayerviewcontrolleranimated:mpvc];
Comments
Post a Comment