Search code examples
iosmpmovieplayercontrollerairplay

Enabling AirPlay for IOS application


Hi I am developing IOS application in which I am showing HLS videos in my application. I want to enable Airplay option for my application. I tried it in following way :

 _moviePlayer =  [[MPMoviePlayerController alloc]
                 initWithContentURL:url];
[_moviePlayer setAllowsAirPlay:YES];

But it is not showing Airplay option for my application. I checked it once I start playing video (my player appears on screen) in my setting AirPlay option is not coming up. Is there any other setting needed. Need Some help. Thank you.


Solution

  • You have to sender and receiver and also same WIFI network then AirPlay is display on iPhone of your screen to access the Control Center. otherwise the AirPlay symbol is not display on Control Center.

    To use AirPlay, you need these:

       1. iPhone 4 (or later), iPad, iPad mini, or iPod touch (4th generation or later)
       2. For videos or photos: Apple TV (2nd or 3rd generation)
       3. For music: Apple TV (2nd or 3rd generation), AirPort Express, or AirPlay-enabled speakers or receivers
    

    Use AirPlay

    1. Connect your iOS device and Apple TV or AirPort Express to the same Wi-Fi network.
    2. Swipe up from the bottom of your screen to access Control Center.
    3. Tap AirPlay.
    

    SNEDER : iPhone 4 (or later), iPad, iPad mini, or iPod touch (4th generation or later)

    RECEIVERS : Apple TV (2nd or 3rd generation), AirPort Express, or AirPlay-enabled speakers or receivers

    Note : SNEDER and RECEIVERS to the same Wi-Fi network.