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.
This commit is contained in:
Jordan Eldredge 2018-09-25 22:31:05 -07:00
parent 5f7948c011
commit 3bd6e931c6
2 changed files with 2 additions and 2 deletions

View file

@ -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,

View file

@ -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();