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
Add playback speed option to song menu #594
Conversation
Hey, thanks for the PR! Really nice addition! I have a few comments that I would like to discuss:
Again, thanks for the PR, I'm sure we can get this merged quickly. I just want to make it even better, while we're at it already :D |
I am not that comfortable with the parentheses situation as well ;D, I will change that. Regarding the settings, I like the idea of adding an "automatic" setting, it could be based on genre ("Speech", "audiobook", ...) and/or maybe album duration (>5h or so)!? That "automatic" setting could then be the default. I think the setting could be placed into "Layout & Theme" (that's where I would look), "Audio Service" is an option as well, but to me it sounds too technical and backend for a UI setting. Adding a dialog for that makes sense of course, the codebase (just like the environment) is just so new to me that I wasn't that comfortable immediately trying to implement that, but I think, I would like to try it now. |
I was thinking of using more definitive clues for the automatic detection, like the type of the BaseItemDto (is it just |
While adding audiobook libraries could be an idea, I don't know if doing automatic audiobook detection based on the library type is ideal. Personally, when I started using Jellyfin and tried the Audiobook support under the Also not sure what the situation is with the Bookshelf plugin and how that is then supposed to be handled. |
Just checked by The audio in a Books library has in fact a type of We could also just do both (checking type and genre) to account for different "setups"? |
Yeah that sounds good. You're right, I always confuse audio books with music videos, that's why I thought there is a dedicated collection. I'm surprised that there's an actual AudioBook type, but I guess otherwise the web frontend wouldn't know how to show/play the items. I'll go ahead and add a new sub-settings page (like tabs) for customization options and move the new setting there, otherwise the layout settings get pretty messy. I'll probably also reorder the settings a bit to move it towards the top. Do you also want me to take a look at adding the details dialog on long press, or do you want to try it yourself first? :) |
I haven't yet checked the returned data for the book library in comparison to a music library, but I will do that. I would try to fetch the album's duration and use that as a basis, if that is a thing with the current architecture I would prefer that over track duration. A new settings page is nice! I am not so sure how to implement your idea with the positioning of the playbackSpeed variable as I don't quite know where to add the |
Apart from having to traverse down into the actual folders ( So maybe adding support for the official Jellyfin Audiobook implementation is really something that could be fairly easily done down the line. |
Okay. Could you check if the duration is properly set for the audiobook album? If that's there, we can use it for the detection. I'd say it should be at least 2h to the automatic detection, do you think that would that work?
That sounds promising, would you be willing to do that in a follow-up PR? With the redesign we can make some breaking changes, so it would be easy to fit it in. I just don't have the resources (nor the interest) to look into audio books right now, but I'm definitely willing to help out a bit! |
Oh, sorry, I just noticed the folder itself (in contrast to the files) seems to somewhat lack metadata actually, it has no RunTimeTicks. The metadata (like RunTimeTicks) would have to be mainly grabbed from the audio items, I guess. After this PR, I will still see what I can do, there seems to be an issue for this already (#231). |
Sorry, seems like I didn't see this message 😅 |
Yes, it does. Thank you! |
I improve upon it a bit, making the icons all have the same size. Do you think the speed text is too small now? 😅 I'm also planning to leave a review tomorrow or on the weekend, there are a few things that I'd like you to tweak :D |
I thought about keeping the size the same, but I didn't particularly like the reduced vertical spacing and thought even with the changed size it looked quite nice. (Edit: And yes, I think the speed text is a bit small.) Matter of taste, I guess ;).
Sure, looking forward to it ;). Just added the album length detection, right now the I was also trying to add the long-press dialog by wrapping the |
Okay, I need to think about the PlaybackAction design some more. I looked at the other actions, and those also contain some sort of state/value for the most part, so they might have to be changed as well. Or we integrate the playback speed into the label more nicely, like "Playing at x1.5 speed" or something. For the Regarding the IconButton and GestureDetector, it probably doesn't work because the IconButton also recognizes gestures. Using just a GestureDetector isn't great for accessibility, because that is not recognized as a button. There's also no easy way to long-press when using a screen reader. For now, go with just the GestureDetector. It still works and can be used with a screen reader, I just need to add some additional semantics info down the road. |
I like that, it would fit right into the design of the sleep timer.
Yes, that was my concern.
Yeah, I just don't know how I'm supposed to fix the IconButton stealing the mouse events from the GestureDetector. |
@jmshrv I like it too, but in my humble opinion a design similar to AntennaPod's might be a bit more fitting. (Considering Finamp's new queue design, etc.) |
Okay, all good points. But I don't think we'll do the long-press stuff, the drop-down / picker list is a nice idea. The way it's implemented in AntennaPod is actually similar to what I had in mind for the long-press dialog, just with presets instead of increment/decrement buttons. I could try to whip up a mockup tomorrow :) |
Like this, maybe? |
In the end, it depends on the width of the device. But we can probably add a bit of margin again, you're right. So the only thing missing now is the pre-fetching of metadata. I can take a look at it, since something similar will be needed for getting lyrics as well. |
I think that's a bit too much, but I'll have to check on my phone later. Maybe it's still possible to select a certain step, in that case all is well. |
At least on my phone it wasn't a problem. |
An alternative would be to have the slider go to 2.5x, but still provide "3x" and "3.5x" presets, for example. Would you like that better? |
Which one do you have?
So the exact opposite of what we have right now? ^^ |
Google Pixel 6a, so, to be fair, quite big. Not sure about the Apple SEs ;).
Yep :D, sorry.
Okay! |
I have an Asus Zenfone 10, so rather small and tall |
Well, selecting the x3.5 results in an exception, a simple clamp should fix that. |
Good point, what a stupid mistake, should have tested for that. I've also added a small indicator for when the user selects a preset value above the maximum the slider can display. |
Yeah that looks good and works well! |
@lymnyx just to give you a quick update, I've now implemented a metadata provider that give us info for the upcoming tracks in #693, which I should be able to re-use for deciding if the button should be shown or not. That means I can get this PR finished up once the lyrics PR is merged. I noticed that the current check might also return true for playlists (depending on where the |
Great, thanks for the update!
In case the
I mean, theoretically we could check the pre-fetched audio for (repeated/prevalent) near-silence and detect typical audiobooks that way, maybe skipping the first few seconds of audio to account for music having to start. Not sure if you would call that reliable or worth it though ;). As we are already checking for the album length (provided that it works as expected which I've assumed) and the item genres, I am not sure what would be left for us to easily and reliably analyze as we obviously have to differentiate normal music tracks and audiobook tracks that might be, as far as the backend is concerned, categorized in precisely the same way. |
yeah that's what I meant, good to know. thanks for testing. Analyzing the audio itself wouldn't be a great idea I think, and much too complex either way. I guess if the speed menu is "accidentally" shown, it's not a big deal... |
Okay, the other PR has now been merged, and I've brought this one up to speed with the latest changes. Hopefully I haven't made mistakes during the merge. I'll look into moving the |
@lymnyx could you give the new changes some testing? Everything should be working now, and if you give the go, I'll include it in the update :D |
- will be shown whenever the playback speed isn't x1.0
@lymnyx many thanks for your efforts with this PR! |
@Chaphasilor Thank you so much for your not-so-minimal assistence and patience <3, really helped a lot. Great to have this in the beta now! |
Description
This PR adds a very basic playback speed option to the new song menu in the
redesign
and thereby fixes #412.Currently, pressing the newly added button computes the new playback speed with
speed % 3.5 + 0.5
, so in steps of 50%.The speed is remembered while the app is open.The speed is saved to the database and with that remembered even after restarts.
As I am very inexperienced with Flutter and Dart, my approach here might not be ideal. If that is the case, just let me know.
Screenshots