-
Notifications
You must be signed in to change notification settings - Fork 6k
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
Support onSetPlaybackSpeed(speed, pitch) in MediaSessionConnector.ComponentListener #8229
Comments
Thanks for reporting. I will look into that. I'm a bit surprised that there is no constant ACTION_SET_PLAYBACK_SPEED speed, because player may not support that. In the case of ExoPlayer, we do support it (unless tunneling is enabled). So I'd have expected that we can signal that, so that the client knows whether this is supported. I check whether we need some more stuff beside this. Many thanks! |
@marcbaechinger I noticed Any chance you could provide an indication of whether adding support for changing playback speed is planned for a future release? Is there any more stuff to be done before that's preventing us from targeting I'd be happy to submit a PR if would speed up (pun intended) the process. |
We are working on this. I started the implementation in It's planned to work on this asap and it will land on the dev-v2 branch as soon as possible. It will be released latest with 2.13 I think, which will be in Q1/2021. I can't give you any guarantees it will land sooner in another release I'm afraid. I will update this issue when the change lands in dev-v2. |
That's great news, and I appreciate the update and rough timeline 👍 I'll keep an eye on |
Issue: #8229 #exofixit PiperOrigin-RevId: 346968046
The change landed in dev-v2 and will be released with 2.13.0. |
Use case description
Android API 29
MediaController
addedsetPlaybackSpeed(float)
, which was backported inMediaControllerCompat
withandroidx.media:media:1.2.0-alpha01
. 1.2.0 become stable mid-September.On the receiving end,
MediaSessionCompat.Callback
also addedonSetPlaybackSpeed(float speed)
. Interestingly, the docs do not yet show this method, but it's definitely there formedia:1.2.0
. It's easy to miss anyways, because theCallback
is an abstract class with empty methods, so nothing it forcing extending classes to actually implement this functionality. The same goes for ExoPlayer'sMediaSessionConnector
, which has aComponentListener
that extendsMediaSessionCompat.Callback
, but does not yet overrideonSetPlaybackSpeed(float speed)
.TLDR: support for setting the playback speed is currently missing in
ComponentListener
.Proposed solution
Override
MediaSessionCompat.Callback.onSetPlaybackSpeed(float speed)
inComponentListener
and forward the playback speed to the actualPlayer
instance. In its most simple form, this could look somewhat like this:Alternatives considered
I wasn't sure whether to file this as bug or feature request, but settles on the latter, because as long as the mediasession extension is not targeting
media:1.2.0
, this is working as expected.If you accept PRs for this matter, I'd be happy to submit one addressing the missing functionality. Although I'm not quite sure if there are any other features from
media:1.1.0
or1.2.0
that would need to be picked up at the same time?The text was updated successfully, but these errors were encountered: