advplyr / audiobookshelf-app

Mobile application for Audiobookshelf
https://audiobookshelf.org
GNU General Public License v3.0
1.22k stars 166 forks source link

Prevent seeking from iOS widget #526

Closed mediadev123 closed 7 months ago

mediadev123 commented 1 year ago

Steps to reproduce

  1. Open the look screen/notification center
  2. Seek inside the audiobook

Expected behaviour

When listing to an audiobook, seeking through the whole audiobook from the iOS play widget (the one you see in the notification center/lock screen) is usually unwanted. This behavior can be supported by other apps such as audible which disable the seeking behavior for audiobooks. This is especially true since audiobooks are quite long and seeking through 20 hours is not a good experience using your fingers (seeking through a single chapter and using the chapter control is another story).

This behavior is especially annoying since it's quite easy to do on accident. For my current audiobook, this has happened around 6 times during the first 10 hours of playback, and finding where I left off can be pretty hard.

This is the widget I am talking about:

Dragging through the little white bar is quite easy to do by accident.

Actual behaviour

Trying to scroll/seek should not register at all.

Changing that behavior should be quite easy here:

https://github.com/advplyr/audiobookshelf-app/blob/master/ios/App/Shared/player/AudioPlayer.swift#L601

You should probably change seekForwardCommand, seekBackwardCommand, and/or changePlaybackPositionCommand from MPRemoteCommandCenter. I am not 100% sure, but you should play and find out what each of those commands do. Unfortunately, I don't have access to xcode to compile and test the app myself right now.

Generally speaking, it would be very useful to have a better "history" of playback sessions and an easy way to reset it. Currently, you can only find "last start" inside the settings from the webapp. It would be cool if this view was available for every audiobook directly. It would also be very helpful if large jumps create new sessions. For example, if I skip ahead/backwards for more than two minutes (and my current listen time is more then 60 secs), a new session should be created. This would make recovering a session easier because sometimes the ios very does not sync with the web version (as in, if I listen on the web, the ios app does not update the position, not sure if I will make another issue for that in the future).

Environment data

Audiobookshelf Version:

Android Issue

Android version:

Device model:

Stock or customized system:

iOS Issue

iOS Version: 16.1.2 (probably not relevant)

iPhone model: not relevant

If you have any more questions, please let me know.

blampe commented 1 year ago

This behavior can be supported by other apps such as audible which disable the seeking behavior for audiobooks.

Do you have a screenshot of what this looks like? My Audible seems to show all the same controls on the lock screen (skip forward/back, duration, etc.).

mediadev123 commented 1 year ago

It does indeed look the same but the progress bar is not interactive. No matter how I drag my finger over it, it only opens the widget center or the camera. With Audiobookshelf, you can drag the bar and very easily change the position which happens quite often when grabbing the phone by the screen (for example when you pull it out of your pocket).

Hope this clarifies it a bit

lukas2511 commented 1 year ago

I'd also love to have seeking disabled, but in my case from the android lockscreen. Happened a few times already that while on the train I accidentally interacted with the slider.

ajaxbits commented 1 year ago

I also experience this issue and would be grateful to see it resolved/enhanced.

fidoriel commented 7 months ago

Why should this be a setting? I do not see any situation in which changing the position on the widget seems desirable to me. I would make it default behavior with #683

ajaxbits commented 7 months ago

I would make it default behavior with https://github.com/advplyr/audiobookshelf-app/pull/683

I agree. I would move to close this issue, or modify it to be a feature request to make scrubbing on the lockscreen configurable.

My original issue has been solved by #683

fidoriel commented 7 months ago

I would make it default behavior with #683

I agree. I would move to close this issue, or modify it to be a feature request to make scrubbing on the lockscreen configurable.

My original issue has been solved by #683

I thought about making it configurable. But I was not able to come up with any valid reason why I would want it scrubbing. Audible does not allow scrubbing either, they also do not allow configuring it. Why making a useless behavior configurable. More work, more docs for what? Maybe @advplyr needs to decide.

fidoriel commented 7 months ago

I took a look at the code, adding the option in the settings seems not much work.

The android pendant seems to be ACTION_SEEK_TO.

Adding allowScrobbingOnWidget in settings, to the json settings parser for swift and Kotlin and a condition what to do when true. I have never done Kotlin, nor a device to test. If a setting is the wished behavior, I can do this in the coming days, but I would prefer a easy fix without a setting, I do not see the benefit of having one.

ajaxbits commented 7 months ago

useless behavior

As a user, I personally disagree with this. There are times where I'd like to navigate, say, 5, 10, or 15 minutes back in my chapter because I've missed something or become distracted. This is common for me when listening to audiobooks and podcasts.

The lockscreen/control center scrubber is a very convenient way to accomplish this. I do it often with Overcast. And with #683, this becomes viable for me in Audiobookshelf as well.

I'm totally down for whatever the team thinks is best from a usability and maintainability standpoint. I understand that a toggle-able feature won't just appear out of thin air and would require work to implement. But I wanted to state my opinion as a daily user. 👍🏻

fidoriel commented 7 months ago

@ajaxbits maybe you are right. It was easy for iOS, #1094 does now include an option to configure. Default: seeking not possible. I did testing on iOS, also added a untested Android version. Need to find time to make an android emulator setup or someone can test it quickly.

advplyr commented 7 months ago

Added in v0.9.73-beta