title: ExoPlayer unable to make connection with camera IP Address
body: <p>I am trying to stream camera preview in an app using RTMP protocol. Since a week, I am debugging ExoPlayer and Librtmp client, But somehow Librtmp client unable to make a connection and fire RtmpIOException which internally getting <code>ECONNREFUSED</code> error. Tried with Socket programming but got the same error. IP ping is working fine. My colleague recently filed an issue on Librtmp GitHub repo. No reply from Devs since January.</p>
  
  <p>We tried with other libs like IJKPlayer(which using FFmpeg internally), It was able to stream preview, But It's having bit more lag before streaming preview and also camera wifi disconnect issues. Can't able to debug further inside due to built up using JNI. </p>
  
  <p>Code:</p>
  
  <pre><code>private val bandwidthMeater = DefaultBandwidthMeter()
  private val adaptiveTrackSelectionFactory = AdaptiveTrackSelection.Factory(bandwidthMeater)
  private val trackSelector = DefaultTrackSelector(adaptiveTrackSelectionFactory)
  
  private val player = ExoPlayerFactory.newSimpleInstance(context, trackSelector)
  
  fun init() {
      player.setVideoSurface(holder.surface)
  }
  
  fun startStream(streamUrl: String, startListener: () -&gt; Unit) {
      //e.g. streamUrl = rtmp://192.168.42.5:1936/live/myStream (IP is Android device IP provide by camera when connected to its wifi)
      val rtmpDatasourceFactory = RtmpDatasource.RtmpDataSourceFactory()
      val factory = ExtractorMediaSource.Factory(rtmpDatasourceFactory)
      val extractorMediaSource =factory.createMediaSource(Uri.parse(streamUrl))   
  
      player.prepare(extractorMediaSource)
      player.playWhenReady = true
  }
  </code></pre>
  
  <p>ExoPlayer Error:</p>
  
  <pre><code>E/ExoPlayerImplInternal: Source error.
         net.butterflytv.rtmp_client.RtmpClient$RtmpIOException
             at net.butterflytv.rtmp_client.RtmpClient.open(RtmpClient.java:56)
             at com.google.android.exoplayer2.ext.rtmp.RtmpDataSource.open(RtmpDataSource.java:57)
             at com.google.android.exoplayer2.source.ExtractorMediaPeriod$ExtractingLoadable.load(ExtractorMediaPeriod.java:841)
             at com.google.android.exoplayer2.upstream.Loader$LoadTask.run(Loader.java:308)
             at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)
             at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)
             at java.lang.Thread.run(Thread.java:818)
  </code></pre>
  
  <p>Connection Error:</p>
  
  <pre><code>java.net.ConnectException: failed to connect to /192.168.42.5 (port 1936): connect failed: ECONNREFUSED (Connection refused)
  </code></pre>