apache / apache/cordova-plugin-media
Play wont work in Android 26
- Dominant language
- JavaScript
- Stars
- 391
- Forks
- 762
- PR merge metrics
- No merged PRs in 30d
Description
# Bug Report
## Problem
11-15 16:15:45.634 27694 28035 W AudioManager: Use of stream types is deprecated for operations other than volume control
11-15 16:15:45.634 27694 28035 W AudioManager: See the documentation of requestAudioFocus() for what to use instead with android.media.AudioAttributes to qualify your playback use case
### What is expected to happen?
Sounds play on .play()
### What does actually happen?
Error thrown, no sound.
## Information
```
Ionic:
Ionic CLI : 5.4.5
Ionic Framework : @ionic/angular 4.11.3
@angular-devkit/build-angular : 0.13.9
@angular-devkit/schematics : 7.3.9
@angular/cli : 7.3.9
@ionic/angular-toolkit : 1.5.1
Cordova:
Cordova CLI : 9.0.0 (cordova-lib@9.0.1)
Cordova Platforms : android 8.1.0, browser 6.0.0, ios 5.0.1
Cordova Plugins : cordova-plugin-ionic-keyboard 2.1.3, cordova-plugin-ionic-webview 4.1.1, (and 16 other plugins)
Utility:
cordova-res : 0.6.0 (update available: 0.8.1)
native-run : 0.2.9
System:
Android SDK Tools : 26.1.1 (/Users/jack/Library/Android/sdk)
ios-deploy : 1.9.4
ios-sim : 8.0.2
NodeJS : v8.16.0 (/usr/local/bin/node)
npm : 6.13.0
OS : macOS Catalina
Xcode : Xcode 11.1 Build version 11A1027
```
### Command or Code
```
let media = new Media('path');
media.play();
```
### Environment, Platform, Device
### Version information
## Checklist
- [ ] I searched for existing GitHub issues
- [ v ] I updated all Cordova tooling to most recent version
- [ v ] I included all the necessary information above
Contributor guide
Research direction
Start by reproducing the issue with `let media = new Media('path'); media.play();` on Android 26 and inspect the reported audio-focus warnings. Compare the failure with the expected sound playback, then verify that `.play()` produces sound without the error on the affected Android setup.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- android, java, javascript
- Domain
- audio-video-rtc, mobile-dev
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100