google / ExoPlayer

This project is deprecated and stale. The latest ExoPlayer code is available in https://github.com/androidx/media
https://developer.android.com/media/media3/exoplayer
Apache License 2.0
21.7k stars 6.01k forks source link

Unable to gain existing stream (RTSP) once internet is OFF and reconnects immediately. #9409

Open SreeniMannem opened 2 years ago

SreeniMannem commented 2 years ago

Hi Team,

I am using ExoPlayer 2.15.0 version to stream RTSP using ip camera.

I am able to stream through RTSP to Android app.

If something happens in between while streaming, like here 2 scenarios to observe.

  1. If internet connection is OFF and back to ON immediately, then the stream stops and displays last frame and its not streaming further.
  2. If RTSP server or IP Camera, went DOWN and UP immediately, then the stream stops and displays last frame and its not streaming further.

In above 2 cases we are unable gain the existing stream by staying on the same page. Once you back and come again, it will stream.

Please help me on how to gain the existing stream even there are Internet fluctuations.

Thanks in advance...

claincly commented 2 years ago

tl;dr For either case, you'll have to set up the RTSP link again. The easiest way will be to use a brand new RtspMediaSource.

For 1, I'll take a closer look. For 2, the server is stateful, if it's down, you have to set up again no matter what.