mirror of
https://github.com/captbaritone/webamp.git
synced 2026-07-25 02:57:30 +00:00
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:
parent
5f7948c011
commit
3bd6e931c6
2 changed files with 2 additions and 2 deletions
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue