Ejemplo n.º 1
0
  public long seekTo(long pos) {
    if (nativeMode) {
      Long intPos = pos;
      mVideoView.seekTo(intPos.intValue());
      return pos;
    } else {
      if (mVlcPlayer == null || !mVlcPlayer.isSeekable()) return -1;
      mForcedTime = pos;
      mLastTime = mVlcPlayer.getTime();
      TvApp.getApplication().getLogger().Info("VLC length in seek is: " + mVlcPlayer.getLength());
      try {
        if (getDuration() > 0) mVlcPlayer.setPosition((float) pos / getDuration());
        else mVlcPlayer.setTime(pos);

        return pos;

      } catch (Exception e) {
        TvApp.getApplication().getLogger().ErrorException("Error seeking in VLC", e);
        Utils.showToast(mActivity, "Unable to seek");
        return -1;
      }
    }
  }