-
-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Detecting shuffle or loop status is broken #35
Comments
Not true. If a player puts up an incomplete interface it is not implemented correctly. All properties that the player wishes to implement should be present and functional when the interface is put up. Having a property appear and disappear is a bug on the part of the player. |
The properties are all present when the interface is up, it's set to |
|
The expectation being that I should be able to change playback mode at anytime similar to volume. Why be able to change the volume when there's nothing to play? Your same argument could be made. |
I understand that It makes sense to shuffle or loop a playlist before it starts playing if your player has local music, or in the case of Spotify, their music seems "local" from Spotify's point of view. My player uses youtube videos as the source, so it actually doesn't make sense to shuffle a playlist before it has started playing, that concept doesn't exist. You could start playing a playlist in shuffle mode, which we do implement, so shuffling happens at the same time as you start to play. The exact same behavior happens with looping, you can't tell youtube to loop a playlist if you haven't started playing it. |
Sure it does just grab the playlist and randomize the order yourself.
Again just play the track or playlist over again. You depend on YouTube to implement shuffle and repeat for you? That seems like you're just asking for trouble. |
I would assume you get playlists as an array of urls? |
I prefer not change properties that often. That's just noise on the bus. That function gets called A LOT. Not to mention that it most likely cause the Shell to lock up because of recursion. Calling |
We don't, we actually do implement shuffle and repeat in our app ourselves, we get an array and do the repeating and shuffling ourselves, not depending on youtube. We were trying to keep the experience as close to how youtube actually works on their site, which is not compatible with how things work on a regular desktop player. I was hoping to not change the experience of the app just to have your extension working. Since the older MPRIS extension was deprecated, more people have complained about using this new one. The old extension didn't have any trouble with shuffle or loop so I went checking how things were done nwo. I thought a simple change in where you run Is this is something that can't be done from your side, I totally understand. |
Well you kinda are a regular desktop player so if I had to go one way or the other I'd behave more like a regular desktop player. |
I totally get that making the change will create more potential problems and it might not be worth it. We'll have to think of something from our side. Maybe some workaround, like checking for consecutive shuffle/loop messages coming right after the start of our app from MPRIS so we can actually respond to those. Implementing things as a regular desktop player will be a bigger change that we'll have to discuss further from our side. Thanks again for taking the time to reply here. I really appreciate all the work you do and I'm a big fan of your work. |
You can blame the ambiguity of the MPRIS spec in general and misbehaving player in particular. In a perfect world everyone would be on the same page and all players would implement the spec correctly and I wouldn't have to sniff and poke properties to make sure they work. I'll tell you what. What's the exact player name as presented to MPRIS in the |
I totally agree with you. When trying to implement MPRIS for the first time the documentation wasn't as straight forward, and relying on how other players implemented things didn't help. The only thing that actually helped me to get it correctly was your old extension. If something wasn't working with that it was because we did something wrong.
I really appreciate that! You're saving us from a lot of work! Thanks so much! |
Right on. I downloaded and am testing Headset right now. The only issue I can see so far is that Headset is showing as 2 MPRIS interfaces. One being the intentional org.mpris.MediaPlayer2.headset and the other org.mpris.MediaPlayer2.chromium.instancerandom number. Chromium/Chrome as of v75 puts up it's own broken interface and I'm guessing electron being based on Chromium does the same. Running headset with |
It doesn't affect my extension because Chromium/Chrome mpris interfaces are ignored because they're broken. It will however show up twice in the default GNOME MPRIS controls. |
See: #10 |
Thanks for finding that! I've never noticed it before. If debugging from the command line, I made sure to only see messages from I'll just make sure that Headset runs with |
I'm on Ubuntu 20.04 also. D-feet is also my go to for quick dbus debugging. I noticed it because I wanted to see how Headset fared in the default controls. |
Most Linux DE's are going to MPRIS for media controls also. That's one reason Chromium puts up the interface. Unfortunately MPRIS lacks any way to track which player is the "active" player so what ends up happening is that DE's just hands the mediakeys to the latest player to show up so you end up with situations where Chromium/Chrome will steal the mediakeys and has no way to give them back to any other player. |
I see it now!!! It's only shown once something starts playing. It's not loaded when the player starts. |
I have no idea how mediakeys work on Windows or Mac. I haven't used either in over 10 years. |
I'll move the conversation regarding |
I have a couple other nitpicks.
|
Generally speaking the defacto unofficial album art size is about a 500x500px square. |
I can look into it, but we've have trouble with this in the past and might not be possible.
This happens because Youtube uses a rectangle for the thumbnails instead of a square, and that's what we pass to MPRIS. I've never been happy with the way they are displayed because they, indeed, look distorted. Headset can easily put a circle on the center of a thumbnail to only display that on the app using javascript, instead of cropping the image. To send a nice image to MPRIS, we would have to crop each image. This has been on my TODO list for a while, and I've avoided it because of the overhead of having to do image manipulation for each thumbnail. |
I figured you were at the mercy of what YouTube gives you.
How much overhead is it actually? Not much I'd imagine.
The only thing I do is force it to be a square not because of this but because some themes murder the style sheets and try to force cover to be a set width. If I don't force a square the cover ends up being 16px wide, which makes all covers look like shit. |
For reference the cover size is dynamic, based on the height of the track info text next to it. So whatever the height of the text is the size of the cover art in a square. |
OK. Round 2 of nitpicks. Icons.
|
How does your extension get the icon of the app? For Linux, we provide icons in two places, the one used in the window itself and the one in the
How do you specify a secondary/alternative icon? Do you add a group header (which one?) in the EDIT: Or do you look for a particular icon size? We could provide the colored SVG and a 32x32 PNG, or smaller, as monochrome, whichever size you use. |
Electron seems to do a good job of apparently putting the full color icon where it's supposed to be because the extension displays it just fine. A 128 x 128 svg for the full color icon should do the trick.
symbolic icons are 16 x 16px one color ( I'm not sure how to go about putting the icon in the proper place when building an electron app but it goes in:
|
Thanks for the info! Support for this type of icons when packaging electron apps will be added soon, see electron-userland/electron-installer-common#70 |
Quick question, for the cover art, can you extension accept a base64 encoded jpg/png URI? |
I'm not sure but I wouldn't. The spec is not clear on what format to use but I would stick to regular jpg and/or png. That's your safest bet to work with any MPRIS widget not just mine. EDIT: No. mpris:artUrl is expected to be a url, preferably a local file. |
Describe the bug
Reading the code, it seems that the function
_testShuffleLoopStatus
toggles the shuffle and loop to test if these are working. I have an MPRIS player (Headset) that has both shuffle and loop implemented correctly but they only work when a song is playing, otherwise, they don't do anything.So, when starting Headset and playing a song, this extension doesn't show either the loop or shuffle buttons. After toggling shuffle or loop from within the app, both buttons are shown in this extension but only the one that was toggled works. For example, if I shuffle within Headset, only the shuffle button will work in the extension, so pressing the loop button doesn't work even though my app can receive that mpris message.
So, maybe detecting that
this._playerProxy.Shuffle !== null
andthis._playerProxy.LoopStatus !== null
might be enough. Or maybe, it'll be better to run_testShuffleLoopStatus
inside_updatePlayerProps
?Steps To Reproduce:
Expected behavior
After playing a song, both loop and shuffle buttons should be displayed and working.
System Details (please complete the following information):
Additional Notes:
From my player's point of view, there's no reason to change either the shuffle or loop status when nothing is playing (stopped not just paused). This will open the alternative that toggling shuffle/loop when nothing is playing will de-synchronize the internal status of the player with mpris. Not a lot of people will do this, but it's better to prevent this situation rather than introduce weird behavior.
The text was updated successfully, but these errors were encountered: