Skip to content

Instantly share code, notes, and snippets.

@evandcoleman
Last active March 15, 2018 17:44
Show Gist options
  • Save evandcoleman/c3ae852fdd888dfa4b472ad662bc1d31 to your computer and use it in GitHub Desktop.
Save evandcoleman/c3ae852fdd888dfa4b472ad662bc1d31 to your computer and use it in GitHub Desktop.
Observing the now playing info of an Apple TV
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