Skip to content Skip to sidebar Skip to footer

Cordova Media Plugin Stopped Working On Android 6

I have an application on Google Play that streams music from a radio station built with the latest cordova (5.4) and I am using some of the basic plugins such as: device plugin cr

Solution 1:

I found the problem, just comment this line on AudioPlayer.java

public void onPrepared(MediaPlayer player) {
    // Listen for playback completionthis.player.setOnCompletionListener(this);
    // seek to any location received while not prepared//this.seekToPlaying(this.seekOnPrepared);// If start playing after preparedif (!this.prepareOnly) {
        this.player.start();
        this.setState(STATE.MEDIA_RUNNING);
        this.seekOnPrepared = 0; //reset only when played
    } else {
        this.setState(STATE.MEDIA_STARTING);
    }
    // Save off durationthis.duration = getDurationInSeconds();
    // reset prepare only flagthis.prepareOnly = true;

    // Send status notification to JavaScript
    sendStatusChange(MEDIA_DURATION, null, this.duration);
}

Solution 2:

Checked on Github in the official repo and found this

Tried on a new sample app and worked fine on my Android 6.0 device. The solution is close to what luckakashi suggested with some extra commenting.

Solution 3:

Seems something wrong from Crosswalk, have you try if you remove the Crosswalk plugin? And is your Android 6.0 device 64-bit?

Post a Comment for "Cordova Media Plugin Stopped Working On Android 6"