airplay - Re-enable mirroring on iOS -
airplay - Re-enable mirroring on iOS -
in ios app need display custom content on external display (using airplay) mirroring screens on tv. presenting custom content utilize code multiple display programming guide ios , works well: while ipad in 'mirror' airplay mode i'm able show stuff on tv. however, documentation says6
to re-enable mirroring after displaying unique content, remove window created appropriate screen object.
and part isn't working @ all. cannot destroy window utilize display content on external screen. here's code:
- (void) destroysecondwindow{ if (secondwindow){ for( uiview* view in secondwindow.subviews ){ [view removefromsuperview]; } secondwindow.backgroundcolor = [uicolor clearcolor]; secondwindow.hidden = yes; // hide , delete window. [secondwindow removefromsuperview]; secondwindow = nil; } }
as far unique content should displayed when 1 particular view controller visible, i'm trying destroy external window this:
- (void) viewwilldisappear:(bool)animated{ [self destroysecondwindow]; }
here's how create sec window:
- (void) createsecondwindowforscreen:(uiscreen*)screen{ if( screen == nil || secondwindow != nil ){ return; } cgrect screenbounds = screen.bounds; secondwindow = [[uiwindow alloc] initwithframe:screenbounds]; secondwindow.backgroundcolor = [uicolor bluecolor]; secondwindow.screen = screen; [secondwindow sethidden:no]; }
so question is: know how re-enable screen mirroring after displaying unique content on tv?
thanks in advance!
ios airplay
Comments
Post a Comment