문제

How can i detect showing on Apple TV?

I've tried already to detect num of screens:

[[UIScreen screens] count]

But it remains on 1.

I've tried also to listen to an event:

    [[NSNotificationCenter defaultCenter] addObserver:self
                                         selector:@selector(screenDidConnect:)
                                             name:UIScreenDidConnectNotification
                                           object:nil];

But the event never fire.

Any tips/tricks?

Thanks in advance!

도움이 되었습니까?

해결책

Found the answer!

As simple as it could be:

Just do:

self.moviePlayer.isAirPlayVideoActive

It will return me whether the AirPlay is active/not active.

Thanks @rist

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top