Skip to content
This repository has been archived by the owner on May 3, 2019. It is now read-only.

GPM: improve playback status detection #129

Merged
merged 1 commit into from
Oct 10, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion AUTHORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,5 @@ Contributors
- [ConorIA](https://github.com/ConorIA)
- [ZeroDot1](http://basic1.moy.su/)
- [Lukas Kolletzki](https://github.com/kolletzki)
- [Mahmoud Hossam](https://github.com/mahmoudhossam)
- [Mahmoud Hossam](https://github.com/mahmoudhossam)
- [Terin Stock](https://github.com/terinjokes)
11 changes: 7 additions & 4 deletions plugins/googleplaymusic/integration.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,14 @@ function getButtons() {
// Much of this was adapted from: https://github.com/tiliado/nuvola-app-google-play-music
//-----------------------------------------------------------------------------
function update() {
var controlClassName = document.querySelector("#player div.material-player-middle").children[3].className;
var playbackStatus = mellowplayer.PlaybackStatus.STOPPED;
if (controlClassName === "x-scope paper-icon-button-0 playing")
var pp = getButtons().playpause;
var playbackStatus;

if (pp.disabled)
playbackStatus = mellowplayer.PlaybackStatus.STOPPED;
else if (pp.className.indexOf("playing") != -1)
playbackStatus = mellowplayer.PlaybackStatus.PLAYING;
else if (controlClassName === "x-scope paper-icon-button-0")
else
playbackStatus = mellowplayer.PlaybackStatus.PAUSED;

var elm;
Expand Down