Last active
March 15, 2018 17:44
-
-
Save evandcoleman/c3ae852fdd888dfa4b472ad662bc1d31 to your computer and use it in GitHub Desktop.
Observing the now playing info of an Apple TV
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
device.on('nowPlaying', (info: NowPlayingInfo) => { | |
if (info == null) { | |
triggerStop(); | |
return; | |
} | |
if (info.playbackState == NowPlayingInfo.State.Playing) { | |
triggerPlay(); | |
} else if (info.playbackState == NowPlayingInfo.State.Paused) { | |
triggerPause(); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment