webmastak / gnome-shell-extensions-mediaplayer

A mediaplayer indicator for GNOME Shell 3.18+.
https://extensions.gnome.org/extension/55/media-player-indicator/
GNU General Public License v2.0
376 stars 106 forks source link

Indicator player state icon keeps disappearing #429

Closed rrthomas closed 5 years ago

rrthomas commented 7 years ago

I have "Show the Indicator Player State Icon" ticked. Since I upgraded to version 61 of the extension, it keeps disappearing; toggling the option off and on makes it reappear.

I am using GNOME 3.18 (Ubuntu 16.04).

Thanks for this useful extension!

lexruee commented 7 years ago

@rrthomas Can you provide the steps or workflow to reproduce this bug? (Music Player etc.)

It sounds like that the following expression in the if condition here becomes false at some point:

let state = this.state;
    if (state.status && this._showPlayStateIcon) {
     ...
      this._secondaryIndicator.show();
      this._secondaryIndicator.set_width(-1);
      this.indicators.show();
    } else {
        this._secondaryIndicator.hide();
    }
rrthomas commented 7 years ago

The icon disappears when the music stops (i.e. when the current playlist ends). I can also make it disappear by pressing Stop (e.g. by adding a Stop button to the player controls, and then using it). I've now had the chance to test this a few times, and it happens every time.

JasonLG1979 commented 7 years ago

@rrthomas What player?

rrthomas commented 7 years ago

Cantata 2.2.0, with its built-in MPRIS support turned off.

JasonLG1979 commented 7 years ago

with its built-in MPRIS support turned off.

If MPRIS is disabled then ofc the player is going to disappear?

rrthomas commented 7 years ago

I don't understand. What does the icon have to do with Cantata?

Maybe I misunderstood, but this used to work as I'd expect: the icon indicated the state of the mpd.

JasonLG1979 commented 7 years ago

This extension works via MPRIS. It is a MPRIS "client" where as the players are MPRIS "servers" If you disable MPRIS in the player it will make the player disappear from the extension.

rrthomas commented 7 years ago

Right, and I'm running mpDris2, sorry, I forgot to mention.

(Sorry, conflated mpd and MPRIS for a moment there.)

Am running version 0.7+git20151224 as shipped with Ubuntu 16.04.

JasonLG1979 commented 7 years ago

I would file a bug with mpDris2. Valid player states are represented by strings "Playing", "Paused", "Stopped". They may be sending an invalid value or no value at all for "Stopped"?

rrthomas commented 7 years ago

What makes you suspect this? This used to work before the last update to this extension.

rrthomas commented 7 years ago

OK, I checked the source of mpDris2: it only sends "Playing", "Paused" or "Stopped".

rrthomas commented 7 years ago

Extra info: when the music stops (I also tried issuing mpc stop: same effect, as you'd hope!), the extension's icon (the headphones symbol) disappears, as well as the actual play state.

Meanwhile, mpDris2's MPRIS panel remains showing in the system menu.

rrthomas commented 7 years ago

W00t! Thanks!

JasonLG1979 commented 7 years ago

Try the master branch and let me know if that does the trick. It makes sure "status" is never null hopefully. I think maybe you exposed an edge case? I don't think it's mpDris2's fault after all.

rrthomas commented 7 years ago

Doing it now…Can't build (see #431).

rrthomas commented 7 years ago

I edited the patch to player.js in manually, and restarted GNOME Shell ("r" command); result: no change.

JasonLG1979 commented 7 years ago

That's strange. Now I'm going to have to install mpd, Cantata and mpDris2 and see if I can't figure this out...

rrthomas commented 7 years ago

OK, having managed to build current git, I confirm the same. I apologise for any harshing effect on your weekend's buzz.

JasonLG1979 commented 7 years ago

OK, having managed to build current git, I confirm the same. I apologise for any harshing effect on your weekend's buzz.

It's all good. This what I do for fun believe it or not. My day job is grease monkey.

rrthomas commented 7 years ago

Mine is singing for the Pope. I will now check the latest mpDris2 just in case.

JasonLG1979 commented 7 years ago

Mine is singing for the Pope

I have no idea what that means?

rrthomas commented 7 years ago

I meant it literally. Open mouth, breathe, exhale through vocal chords, Ad Maiorem Dei Gloriam in the local Catholic cathedral.

rrthomas commented 7 years ago

OK, have installed mpdris2-0.7+git20160917-1 (the latest version I can find packaged), and the result is exactly the same.

JasonLG1979 commented 7 years ago

I meant it literally. Open mouth, breathe, exhale through vocal chords, Ad Maiorem Dei Gloriam in the local Catholic cathedral.

I wasn't sure if that was some kinda slang,lol!!! Right on. I can't carry a tune in a bucket,lol!!! I do play a bad bass though.(when I say bad I mean not very good either...)

OK, have installed mpdris2-0.7+git20160917-1 (the latest version I can find packaged), and the result is exactly the same.

I'm editing the wiki right now and I'll give it a test here sometime this weekend.

rrthomas commented 7 years ago

Yes, reading it back it does look like it could be something you'd find in Urban Dictionary.

JasonLG1979 commented 7 years ago

Yes, reading it back it does look like it could be something you'd find in Urban Dictionary.

Yes either some sort of lewd act or perhaps a position in a crime syndicate,lol!!!

JasonLG1979 commented 5 years ago

https://github.com/JasonLG1979/gnome-shell-extensions-mediaplayer/blob/master/README.md