这是indexloc提供的服务,不要输入任何密码
Skip to content

Add the setter counter part of Player.getMaxSeekToPreviousPosition() #1425

@MGaetan89

Description

@MGaetan89

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.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions