Skip to content
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 the setter counter part of Player.getMaxSeekToPreviousPosition() #1425

Closed
MGaetan89 opened this issue Jun 4, 2024 · 4 comments
Closed
Assignees

Comments

@MGaetan89
Copy link
Contributor

Use case description

Currently, the Player interface provides a getMaxSeekToPreviousPosition() method, which returns a delay after which the player seeks to the previous item, instead of restarting the current item, when calling Player.seekToPrevious(). That delay is currently hardcoded to C.DEFAULT_MAX_SEEK_TO_PREVIOUS_POSITION_MS (3 seconds).
There is also a Player.Listener.onMaxSeekToPreviousPositionChanged(long) method, which is called when the delay changes. However, as far as we could see, there is currently no Player.setMaxSeekToPreviousPosition(long) method, allowing us to customise that delay.

Proposed solution

Provide a Player.setMaxSeekToPreviousPosition(long) method se the delay can be freely customised by developers.
If this request seems reasonable to you, I'm open to work on a PR to help integrate it in Media3.

Alternatives considered

Keep working with the current default delay.

@tonihei
Copy link
Collaborator

tonihei commented Jun 5, 2024

There is no particular not to have such a setter. Do you want to send a PR to add it to ExoPlayer.Builder (assuming you only want to set it once)? You can copy the pattern from setSeekBackIncrementMs.

@MGaetan89
Copy link
Contributor Author

Yes, I can work on a PR for that

@MGaetan89
Copy link
Contributor Author

MGaetan89 commented Jun 17, 2024

I'm closing this, since #1437 has been merged.

Feel free to repoen if you prefer to close once it is released.

@tonihei
Copy link
Collaborator

tonihei commented Jun 17, 2024

Closing now is fine. Thanks again for the contribution!

@androidx androidx locked and limited conversation to collaborators Aug 17, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants