apache / apache/cordova-plugin-media
[Android only] Audio file doesn't play
- Dominant language
- JavaScript
- Stars
- 391
- Forks
- 762
- PR merge metrics
- No merged PRs in 30d
Description
```
import {Media, MediaObject} from "@ionic-native/media/ngx";
constructor(
private media: Media,
) { }
```
```
const mp3file: MediaObject = this.media.create(url);
mp3file.play();
```
On iOs the code above is working properly, however on Android no sound is coming out and I have no error message.
Any idea ?
_Ionic:
Ionic CLI : 5.4.15
Ionic Framework : @ionic/angular 5.0.0
@angular-devkit/build-angular : 0.803.23
@angular-devkit/schematics : 8.1.3
@angular/cli : 8.1.3
@ionic/angular-toolkit : 2.1.2
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 11 other plugins)
Utility:
cordova-res : not installed
native-run (update available: 1.0.0) : 0.2.8
System:
Android SDK Tools : 26.1.1 (/Users/merwanropers/Library/Android/sdk)
ios-deploy : 1.9.4
NodeJS : v14.0.0 (/usr/local/Cellar/node/14.0.0/bin/node)
npm : 6.14.4
OS : macOS Catalina
Xcode : Xcode 11.4 Build version 11E146_
Contributor guide
Research direction
Start with the Android behavior of Media.create(url) and MediaObject.play() using the Ionic, Cordova, and Android versions reported in the issue, then compare it with the working iOS path. Reproduce the silent playback and inspect the Android-side result or error; done means the MP3 plays on Android or the failure is reported clearly.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- android, javascript
- Domain
- mobile-dev
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100