Skip to content

Commit

Permalink
Merge pull request #320 from GerardSmit/master
Browse files Browse the repository at this point in the history
Fix YouTube Music controls
  • Loading branch information
feedbee authored Apr 24, 2019
2 parents b89e879 + 163f6c6 commit ff78608
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions extension/keysocket-youtube-music.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@ keySocket.init(
"youtube.music",
function (key) {
if (key === keySocket.NEXT) {
var nextButton = document.querySelector('#left-controls > div > paper-icon-button:nth-child(3)');
var nextButton = document.querySelector('#left-controls > div > paper-icon-button.next-button');
keySocket.simulateClick(nextButton);
} else if (key === keySocket.PLAY) {
var playPauseButton = document.querySelector('#left-controls > div > paper-icon-button.play-pause-button.style-scope.ytmusic-player-bar');
var playPauseButton = document.querySelector('#left-controls > div > paper-icon-button.play-pause-button');
playPauseButton.click();
} else if (key === keySocket.PREV) {
var backButton = document.querySelector('#left-controls > div > paper-icon-button:nth-child(1)');
var backButton = document.querySelector('#left-controls > div > paper-icon-button.previous-button');
keySocket.simulateClick(backButton);
} else if (key === keySocket.STOP) {
var stopButton = document.querySelector('#left-controls > div > paper-icon-button.play-pause-button.style-scope.ytmusic-player-bar');
var stopButton = document.querySelector('#left-controls > div > paper-icon-button.play-pause-button');
stopButton.click();
}
}
Expand Down

0 comments on commit ff78608

Please sign in to comment.