2

i'm trying to set the commands of exoPlayer but i don't know how to set the

getDuration();
getCurrentPosition();

I found this but what i have to set on UNKNOWN_TIME cause its telling me cannot resolve symbol UNKNOWN_TIME

@Override
public int getCurrentPosition() {
    return exoPlayer.getDuration() == ExoPlayer.UNKNOWN_TIME ? 0
            : (int) exoPlayer.getCurrentPosition();
}

@Override
public int getDuration() {
    return exoPlayer.getDuration() == ExoPlayer.UNKNOWN_TIME ? 0
            : (int) exoPlayer.getDuration();
}
Andrii Omelchenko
  • 13,183
  • 12
  • 43
  • 79
Franko Loshe
  • 109
  • 2
  • 12
  • Possible duplicate of [What does a "Cannot find symbol" compilation error mean?](http://stackoverflow.com/questions/25706216/what-does-a-cannot-find-symbol-compilation-error-mean) – azurefrog Jan 24 '17 at 15:56
  • not helping me ..exoplayer is a library and when i do exoplayer.UNKNOWN_TIME should be there but isnt there – Franko Loshe Jan 24 '17 at 16:02
  • im playing an mp3 by url and on seekbar i have to set exoPlayer.getDuration(); but first i have to set the commands – Franko Loshe Jan 24 '17 at 16:04
  • like this http://stackoverflow.com/questions/32926483/exoplayer-and-start-pause-seekto-commands – Franko Loshe Jan 24 '17 at 16:05

1 Answers1

3

For ExoPlayer 2.0 You should use C.TIME_UNSET constant (from com.google.android.exoplayer2 package) instead of ExoPlayer.UNKNOWN_TIME (see this description for getDuration() method for ExoPlayer 2.0.

Andrii Omelchenko
  • 13,183
  • 12
  • 43
  • 79