Audio focus handling with more than one ExoPlayer-instance/video-playing
@tianyif is already working on this.
Since Oct 14, 2024.
- Dominant language
- Java
- Stars
- 3k
- Forks
- 955
- Avg merge
- 12d 14h
- Merged PRs (30d)
- 2
Description
Version
Media3 1.4.1
More version details
Also tested and seen in v1.1.0
Devices that reproduce the issue
Seen on every device tested on, including:
- Google Pixel 7
- Xiaomi Mi 10T
- Samsung Galaxy S22 Ultra
Devices that do not reproduce the issue
No response
Reproducible in the demo app?
Not tested
Reproduction steps
- Create two ExoPlayer instances
- set: setAudioAttributes(new AudioAttributes.Builder().build(), true) on both instances
- Play videos on both instances
- One video will not be playing
- Background the app and bring to foreground, videos will swap which one is playing and which one is not
NOTE: I generated the bug report after step (4) but before step (5), as I thought step (5) might cloud the logging.
Change the 'handleAudioFocus' parameter passed into 'setAudioAttributes' to false and both videos play correctly, but we lose functionality of playback being paused when a phone call comes into the device (and resumed afterwards).
I have also tried setting the following on 'AudioAttributes.Builder()':
.setUsage(C.USAGE_MEDIA)
.setContentType(C.AUDIO_CONTENT_TYPE_MOVIE)
Expected result
Both videos play
Actual result
Only one video plays
Media
Any two MP4's - resolution, bitrate, codec are unimportant.
Tested with two h264 low resolution videos.
Bug Report
- You will email the zip file produced by
adb bugreportto android-media-github@google.com after filing this issue.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.