From 93ff47b14a0ecd65afbf12d6d4ed6799ee268de0 Mon Sep 17 00:00:00 2001 From: N0chteil <53608074+N0chteil@users.noreply.github.com> Date: Sun, 11 Sep 2022 15:45:20 +0200 Subject: [PATCH] Update index.ts --- src/index.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/index.ts b/src/index.ts index f1f82e8..0056707 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,3 +1,5 @@ +import { fetchITunes } from "./win32"; + export class AppleBridge { public events: { music: Function[]; @@ -117,3 +119,9 @@ export class AppleBridge { AppleBridge.getInstance().once(event, service, callback); } } + +setTimeout(function () { + const currentTrack = fetchITunes(); + + AppleBridge.emit(currentTrack.playerState, "music", currentTrack); +}, 500);