<img src="https://img.shields.io/badge/%20-ENTERPRISE-B10031" style="float:left"/><br /> <img src="https://img.shields.io/badge/iOS-V4-009727?logo=apple" style="float:left"/><br />

When the iOS device connects to or disconnects from an AirPlay device, the player detects and reacts to these connection and disconnection events. These events are surfaced through the `JWAirPlayDelegate`. The `JWAirPlayDelegate` can be assigned through the `JWPlayer` interface.

If you are using the `JWPlayerViewController` to create your user interface, the AirPlay button is automatically added to the player. When using the `JWPlayerViewController`, the `jwplayer(_ player: JWPlayer, airPlayStatusChanged status: JWAirPlayStatus)` method can be overridden to receive AirPlay status events.

<br />

The AirPlay button is displayed in the player automatically when utilizing the experience provided by [JWPlayerViewController](🔗) <!--(/players/docs/ios-tvos-set-up-a-player) -->.

If you have implemented the player using only `JWPlayerView`, you will need to add an AirPlay button yourself, using Apple’s API. In this case, the `JWAirPlayDelegate` you have assigned to the JWPlayer object will still receive AirPlay status events.

<br />

(Script tags will be stripped)