コード例 #1
0
  /**
   * Retrieves the current position of the audio playback. If an audio item is not currently in
   * playback then the value will be 0. This should only be called after the item is prepared (see
   * {@link #setOnPreparedListener(android.media.MediaPlayer.OnPreparedListener)})
   *
   * @return The millisecond value for the current position
   */
  public long getCurrentPosition() {
    if (overridePosition) {
      return positionOffset + overriddenPositionStopWatch.getTime();
    }

    if (!listenerMux.isPrepared()) {
      return 0;
    }

    if (!useExo) {
      return positionOffset + videoView.getCurrentPosition();
    }

    return positionOffset + emExoPlayer.getCurrentPosition();
  }