From 3bd6e931c6ea839cb78e2a557d06f5f0c81f41b6 Mon Sep 17 00:00:00 2001 From: Jordan Eldredge Date: Tue, 25 Sep 2018 22:31:05 -0700 Subject: [PATCH] Make onTrackDidChange public again. I realized that onTrackDidChange was already a public API, and that while I'm not sure if the new approach is 100% correct, it's surely better than the old one. --- js/mediaSession.js | 2 +- js/webampLazy.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/js/mediaSession.js b/js/mediaSession.js index d187ba10..05105568 100644 --- a/js/mediaSession.js +++ b/js/mediaSession.js @@ -1,7 +1,7 @@ export default function enableMediaSession(webamp) { if ("mediaSession" in navigator) { /* global MediaMetadata */ - webamp.__onTrackDidChange(({ title, artist, album, albumArtUrl }) => { + webamp.onTrackDidChange(({ title, artist, album, albumArtUrl }) => { navigator.mediaSession.metadata = new MediaMetadata({ title, artist, diff --git a/js/webampLazy.js b/js/webampLazy.js index 9f2483fa..7f9ce92d 100644 --- a/js/webampLazy.js +++ b/js/webampLazy.js @@ -222,7 +222,7 @@ class Winamp { return this._actionEmitter.on(CLOSE_WINAMP, cb); } - __onTrackDidChange(cb) { + onTrackDidChange(cb) { let previousTrackId = null; this.store.subscribe(() => { const state = this.store.getState();