-
Notifications
You must be signed in to change notification settings - Fork 409
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
Register correct MediaButtonReceiver
in MediaSessionLegacyStub
#314
Comments
When running
The following pending intent is registered:
However, the pending intent is already cancelled by the the instead, the When the session is created:
When the session is released:
Note: An app can only be restarted by BT headset if:
A fix for this is in review internally. Related documentation: |
This change selects the best suited media button receiver component and pending intent when creating the legacy session. This is important to ensure that a service can be started with a media button event from BT headsets after the app has been terminated. The `MediaSessionLegacyStub` selects the best suited receiver to be passed to the `MediaSessionCompat` constructor. 1. When the app has declared a broadcast receiver for `ACTION_MEDIA_BUTTON` in the manifest, this broadcast receiver is used. 2. When the session is housed in a service, the service component is used as a fallback. 3. As a last resort a receiver is created at runtime. When the `MediaSessionLegacyStub` is released, the media button receiver is removed unless the app has provided a media button receiver in the manifest. In this case we assume the app supports resuming when the BT play intent arrives at `MediaSessionService.onStartCommand`. #minor-release Issue: #167 Issue: #27 Issue: #314 PiperOrigin-RevId: 523638051
This change selects the best suited media button receiver component and pending intent when creating the legacy session. This is important to ensure that a service can be started with a media button event from BT headsets after the app has been terminated. The `MediaSessionLegacyStub` selects the best suited receiver to be passed to the `MediaSessionCompat` constructor. 1. When the app has declared a broadcast receiver for `ACTION_MEDIA_BUTTON` in the manifest, this broadcast receiver is used. 2. When the session is housed in a service, the service component is used as a fallback. 3. As a last resort a receiver is created at runtime. When the `MediaSessionLegacyStub` is released, the media button receiver is removed unless the app has provided a media button receiver in the manifest. In this case we assume the app supports resuming when the BT play intent arrives at `MediaSessionService.onStartCommand`. Issue: #167 Issue: #27 Issue: #314 PiperOrigin-RevId: 523638051 (cherry picked from commit e54a934)
Closing as this is released with 1.0.1. |
Media3 Version
Media3 1.0.0
Devices that reproduce the issue
All devices
Devices that do not reproduce the issue
No response
Reproducible in the demo app?
Yes
Reproduction steps
Expected result
App is started again
Actual result
CancellationException
because thePendingIntent
is cancelled.Media
Any media from the session demo
Bug Report
adb bugreport
to dev.exoplayer@gmail.com after filing this issue.The text was updated successfully, but these errors were encountered: