google / google/ExoPlayer

Improve documentation on routing of volume key events to active MediaSession

Open
#5,050 2 comments 2 reactions 1 assignee Claimed by @AquilesCanta View on GitHub
documentation candidate
Dominant language
Java
Stars
21.9k
Forks
6k
PR merge metrics
No merged PRs in 30d

Description

### Issue description
When playing content using the CastPlayer, the device's physical volume buttons should control the receiver device's volume. This behaves as expected when the CastPlayer is contained within an Activity. However, when the CastPlayer is contained within a Service (such as a MediaBrowserServiceCompat) the physical volume buttons change the sender device's media volume.

### Reproduction steps
I've created 2 sample projects:

- [CastVolumeControlTest](https://github.com/deRonbrown/CastVolumeControlTest) shows the proper volume control stream behavior while casting.
- [CastVolumeControlServiceTest](https://github.com/deRonbrown/CastVolumeControlServiceTest) shows the incorrect volume control stream behavior while casting.

### Link to test content
Test mp4 file is used in sample projects above.

### Version of ExoPlayer being used
Core 2.8.4 and Cast Extension 2.8.4

### Device(s) and version(s) of Android being used
Reproduces on 9.0 and 8.1.0.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.