framework/src/org/apache/cordova/AudioPlayer.java
/**
     * Callback to be invoked when the media source is ready for playback. 
     * 
     * @param mPlayer           The MediaPlayer that is ready for playback 
     */
Callback to be invoked when the media source is ready for playback.

@param mPlayer           The MediaPlayer that is ready for playback
Callback to be invoked when the media source is ready for playback . @param mPlayer The MediaPlayer that is ready for playback
public void onPrepared(MediaPlayer mPlayer) {
        this.mPlayer.setOnCompletionListener(this);
        if (!this.prepareOnly) {
            this.mPlayer.start();
            this.setState(MEDIA_RUNNING);
        }
        this.duration = getDurationInSeconds();
        this.prepareOnly = false;
        this.handler.sendJavascript("cordova.require('cordova/plugin/Media').onStatus('" + this.id + "', " + MEDIA_DURATION + "," + this.duration + ");");
    }
public void onPrepared ( MediaPlayer mPlayer ) { this . mPlayer . setOnCompletionListener ( this ) ; if ( ! this . prepareOnly ) { this . mPlayer . start ( ) ; this . setState ( MEDIA_RUNNING ) ; } this . duration = getDurationInSeconds ( ) ; this . prepareOnly = false ; this . handler . sendJavascript ( "cordova.require('cordova/plugin/Media').onStatus('" + this . id + "', " + MEDIA_DURATION + "," + this . duration + ");" ) ; }
Callback to be invoked when the media source is ready for playback.
Callback to be invoked when the media source is ready for playback .
// Listen for playback completion // If start playing after prepared // Start playing // Set player init flag // Save off duration // Send status notification to JavaScript