HDMI state changes
Applications might receive HDMI state change notifications for several possible reasons. For example, because the TV was powered OFF, TV input was switched to another HDMI port, the HDMI cable was physically disconnected, or the HDMI settings were adjusted on the video receiver.- Applications must pause video playback when an HDMI disconnection event is received. Apps playing live content (or any content that cannot be paused) must return to the details page and stop playing content. When an HDMI sink reconnection event message is received, playback should remain paused until the user presses the PLAY button on the remote.
- Applications playing only audio might continue to play even after the HDMI disconnection event is received, provided they confirm that an audio output device is still available (like a connected Bluetooth speaker).
Available APIs
There are various ways to listen to changes in the HDMI state. The preferred way from Android Marshmallow (Fire OS 6) is through theAudioDeviceCallback APIs. These APIs are faster and provide more information about the state change than intents.
Applications targeting Fire OS 5 can only listen for the intent ACTION_HDMI_AUDIO_PLUG that has an extra EXTRA_AUDIO_PLUG_STATE showing the HDMI connection state (plugged-in or unplugged).
Applications targeting all Fire OS versions should decide which solution to use based on the runtime API level support of the platform.

