Skip to content

Commit

Permalink
fixed implementation for spotify
Browse files Browse the repository at this point in the history
  • Loading branch information
carlin-q-scott committed Oct 25, 2019
1 parent 285d3fa commit 6fb4ad9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion data/orchestrator.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ MediaKeys.Init = function () {
async function setupTrackInfoUpdates() {
let timeout;
function notifyNewTrack() {
// console.log('clearing timeout ' + timeout);
clearTimeout(timeout);
timeout = setTimeout(() => {
new Notification('Now Playing', {
Expand All @@ -103,7 +104,7 @@ MediaKeys.Init = function () {
var currentTrackObserver = new MutationObserver(notifyNewTrack);
currentTrackObserver.observe(currentTrackObservable, {
childList: true,
characterData: false, //TODO: this is needed for open.spotify notifications, but catches progress bar on pandora
attributes: true,
subtree: true
});
}
Expand Down
4 changes: 2 additions & 2 deletions data/pandora.com-view.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ MediaKeys.playButton = 'button.PlayButton[data-qa="play_button"]';
MediaKeys.pauseButton = 'button.PlayButton[data-qa="pause_button"]';
MediaKeys.previousButton = 'button.ReplayButton';
MediaKeys.skipButton = 'button.SkipButton';
MediaKeys.trackInfo = 'div.Tuner__Audio__TrackDetail';
MediaKeys.getTrackImageUrl = () => MediaKeys.find(MediaKeys.trackInfo + ' img').src;
MediaKeys.trackInfo = 'div.Tuner__Audio__TrackDetail__labels';
MediaKeys.getTrackImageUrl = () => MediaKeys.find('div.Tuner__Audio__TrackDetail__img img').src;

0 comments on commit 6fb4ad9

Please sign in to comment.