0

Hi i am building iOS application target iOS 5 and above. I am using MPMoviePlayerController to stream movie file. I that player i want to give airplay support.

According to apple documentation

Default Movie players (iOS 4.3 and later) support wireless movie playback to AirPlay-enabled hardware such as Apple TV. The movie player presents a control that allows the user to choose AirPlay-enabled hardware for playback when such hardware is in range.

It seems that by default it will display airplay button in fullscreen mode if any airplay device is in range. But it is not seems to be happening. I am unable to see airplay button in movie player.

Am i missing something? Please advise.

Till
  • 27,559
  • 13
  • 88
  • 122
abdus.me
  • 1,819
  • 22
  • 34

1 Answers1

1

By default, MPMoviePlayerController enables AirPlay support. If you haven't set it as FALSE. Then, probably you need to check your network or AppleTV's network connection. They need to be in same network (intranet usually).

There is a safe way to detect whether your iOS device is able to find AppleTV. You can double click HOME button, swipe task bar from left to right side, if you can see "Airplay" route button, then you can reach it. Otherwise, you need to check your AppleTV setting to make sure Airplay function is enabled and AppleTV is connected to same network that you iOS device in.

If you are using your own customized video play controller interface, you can embedded the "Airplay" button into your own UI.

MPVolumeView

Hail Zhang
  • 239
  • 4
  • 8
  • Well thanks for your answer, please tell that can i test this functionality using Apple TV only? or there is another device or another way to test it. – abdus.me Aug 17 '13 at 20:49
  • Yes, you can. You can connect your iPhone/iPad to TV / monitor through HDMI cable which will be managed as same as Apple TV (but not identical, you will be able to detect the difference from SDK). – Hail Zhang Sep 08 '13 at 19:12
  • 1
    @abdus.me you could also use software services like [AirServer](http://www.airserver.com/). – Till Dec 16 '13 at 14:38
  • @HailZhang how exactly can you detect the difference between standard Apple TV usage and HDMI cable from SDK? – Spail Feb 17 '15 at 10:18
  • @Spail You can check current audio route to identify which route currently being used. Search this AVAudioSessionRouteDescription you will see more details. – Hail Zhang Feb 18 '15 at 18:37