ios - How to play a video in landscape mode but app support only portrait mode? -


i making application support portrait mode.here iam loading youtube videos in uiwebview. when switch landscape mode video has play in landscape mode also. after taping on done of videoplayer. view controller changing landscape mode has in portrait mode here webview code

         web=[[uiwebview alloc]initwithframe:cgrectmake(2,0, 140, 99)];           web.backgroundcolor=[uicolor redcolor];         [web setdatadetectortypes: uidatadetectortypenone];          nsstring *embedhtml = @"<iframe title=\"youtube video player\" width=\"320\" height=\"460\" scrolling=\"no\" src=\"http://www.youtube.com/embed/%@?modestbranding=1&amp;rel=0;autoplay=1;showinfo=0;loop=1;autohide=1\" frameborder=\"0\" allowfullscreen allowtransparency=\"true\"></iframe>";          nsstring *htmlstr = [nsstring stringwithformat:embedhtml, [youtubeid_array objectatindex:i]];                        web.tag=i+100;         web.scrollview.bounces=no;         [web loadhtmlstring:htmlstr baseurl:nil];         [view addsubview:web];    -(bool)shouldautorotatetointerfaceorientation:(uiinterfaceorientation)tointerfaceorientation {     return ( tointerfaceorientation=uiinterfaceorientationportrait); } 

have tried set rootviewcontroller self when returning app?

in viewcontroller:

import "appdelegate.h" ... - (void)functionrunwhenvideofinish {     ...     self.appdelegate.window.rootviewcontroller = self;     ... } 

Comments

Popular posts from this blog

monitor web browser programmatically in Android? -

Shrink a YouTube video to responsive width -

wpf - PdfWriter.GetInstance throws System.NullReferenceException -