diff --git a/scripts/deezer/player_observer.js b/scripts/deezer/player_observer.js index a10aea1..deccb62 100644 --- a/scripts/deezer/player_observer.js +++ b/scripts/deezer/player_observer.js @@ -122,7 +122,7 @@ } // get data from JS object dzPlayer - function updateDeezerControlData() { + function updateDeezerControlData(event, data) { "use strict"; var DeezerControlData = document.getElementById('DeezerControlData'), isPlaying = dzPlayer.isPlaying(), @@ -144,6 +144,11 @@ break; } + // the data parameter depends on the event type + if (event && event.namespace === 'PLAYER.pause') { + isPlaying = !data; + } + DeezerControlData.setAttribute('dz_is_active', true); DeezerControlData.setAttribute('dz_playing', isPlaying); DeezerControlData.setAttribute('dz_artist', metadata.artist);