Example usage for org.apache.cordova AudioPlayer getCurrentPosition

List of usage examples for org.apache.cordova AudioPlayer getCurrentPosition

Introduction

In this page you can find the example usage for org.apache.cordova AudioPlayer getCurrentPosition.

Prototype

public long getCurrentPosition() 

Source Link

Document

Get current position of playback.

Usage

From source file:com.candygram.media.AudioHandler.java

License:Apache License

/**
 * Get current position of playback.//www  .  j a  va  2 s.  c o m
 * @param id            The id of the audio player
 * @return                position in msec
 */
public float getCurrentPositionAudio(String id) {
    AudioPlayer audio = this.players.get(id);
    if (audio != null) {
        return (audio.getCurrentPosition() / 1000.0f);
    }
    return -1;
}