title: how to know when ExoPlayer is ready to play?
body: <p>I am replacing MediaPlayer with ExoPlayer.
  I followed the guide
  <a href="https://google.github.io/ExoPlayer/guide.html" rel="nofollow noreferrer">https://google.github.io/ExoPlayer/guide.html</a></p>
  
  <pre><code>public class cl_ExoPlayer {
      Map&lt;String,SimpleExoPlayer&gt; player = new HashMap&lt;String,SimpleExoPlayer&gt;();
      Integer are_loading = 0 ;
  
      // 1. Create a default TrackSelector
      Handler mainHandler = new Handler();
      BandwidthMeter bandwidthMeter = new DefaultBandwidthMeter();
      TrackSelection.Factory audioTrackSelectionFactory = new AdaptiveTrackSelection.Factory(bandwidthMeter);
      TrackSelector trackSelector = new DefaultTrackSelector(audioTrackSelectionFactory);
  
  
      void snd_load( String file_name , String url ) {
          try {
              String file_name_with_ext = url.substring(url.lastIndexOf("/") + 1); // snd_title.ogg
                  String file_name_without_ext = file_name_with_ext.substring(0, file_name_with_ext.indexOf(".")); // snd_title
  
              Uri uri ;
              int resId = getApplicationContext().getResources().getIdentifier(file_name_without_ext, "raw", getApplicationContext().getPackageName());
              if (resId != 0){ uri = Uri.parse("android.resource://" + getApplicationContext().getPackageName() + "/raw/" + file_name_without_ext); }
              else{ uri = Uri.parse("http://diegotests.altervista.org/html5_games/8bit_pocket_wrestlers/" + url); }
  
              // 2. Create the player
              player.put( file_name, ExoPlayerFactory.newSimpleInstance(getApplicationContext(), trackSelector) );
  
              // Measures bandwidth during playback. Can be null if not required.
              DefaultBandwidthMeter bandwidthMeter = new DefaultBandwidthMeter();
              // Produces DataSource instances through which media data is loaded.
              DataSource.Factory dataSourceFactory = new DefaultDataSourceFactory(getApplicationContext(),
                                      Util.getUserAgent(getApplicationContext(), "yourApplicationName"), bandwidthMeter);
              // This is the MediaSource representing the media to be played.
              MediaSource audioSource = new ExtractorMediaSource.Factory(dataSourceFactory)
                                      .createMediaSource(uri);
              // Prepare the player with the source.
              are_loading++;
              player.get(file_name).prepare(audioSource);
  </code></pre>
  
  <p>Now I want to know when it is finished loading the file, decoding it and ready to play. I do not use .setPlayWhenReady() because I do NOT want it to start playing as soon as it is ready. The only way I read about on the internet is always :</p>
  
  <pre><code>        player.get(file_name).addListener( new Player.EventListener() {
              @Override
              public void onPlayerStateChanged(boolean playWhenReady, int playbackState) {
                  if (playbackState == Player.STATE_READY) {
  
                  }
              }
          });
  </code></pre>
  
  <p>But it does not work.
  I get error</p>
  
  <p><code>error: &lt;anonymous didi.a8bitpocketwrestlers.cl_ExoPlayer$1&gt; is not abstract and does not override abstract method onSeekProcessed() in EventListener</code></p>
  
  <p>I read many pages about this error but I still do not understand, everytime it is so different from what I am trying to do here.</p>
  
  <p>If I can't add this event listener, is there any other way to know when ExoPlayer is ready to play ?</p>