In my Android application am showing live video streaming using LibVLC
library. To connect SSH server i have used jsch
library.
When i run application, after session connection video runs properly. and when i minimize the app for 3-4 minutes, and resume again still video runs properly. But when i minimize the application for 10 or more minutes and on resume it shows session timeout
message.
OnResume()
I tried to create session and createPlayer()
but still not working .
I have tried by changing session connect time.
Is there is any way to avoid session timeout for long period like 30 minutes.
//** AFTER EDIT**//
I checked after onResume()
session is still connected, and error log says Connection reset by peer.
What does that mean? Is ssh tunnel is closed? If yes, how to check ssh tunnel status?
Error log:
08-09 10:52:15.268 6529-21339/com.compdigitec.libvlcandroidsample E/VLC: live555 demux: Failed to connect with rtsp://localhost:8554/video.ts 08-09 10:52:15.268 6529-21339/com.compdigitec.libvlcandroidsample D/VLC: core demux: no access_demux modules matched 08-09 10:52:15.268 6529-21339/com.compdigitec.libvlcandroidsample D/VLC: core input: creating access 'rtsp' location='localhost:8554/video.ts', path='(null)' 08-09 10:52:15.268 6529-21339/com.compdigitec.libvlcandroidsample D/VLC: core access: looking for access module matching "rtsp": 15 candidates 08-09 10:52:15.268 6529-21339/com.compdigitec.libvlcandroidsample D/VLC: core access: net: connecting to localhost port 8554 08-09 10:52:15.278 6529-21339/com.compdigitec.libvlcandroidsample D/VLC: core access: connection succeeded (socket = 36) 08-09 10:52:35.823 6529-21339/com.compdigitec.libvlcandroidsample E/VLC: core access: read error: Connection reset by peer 08-09 10:52:35.823 6529-21339/com.compdigitec.libvlcandroidsample D/VLC: access_realrtsp access: rtsp connected 08-09 10:52:35.823 6529-21339/com.compdigitec.libvlcandroidsample W/VLC: access_realrtsp access: only real/helix rtsp servers supported for now 08-09 10:52:35.823 6529-21339/com.compdigitec.libvlcandroidsample D/VLC: core access: no access modules matched 08-09 10:52:35.823 6529-21339/com.compdigitec.libvlcandroidsample E/VLC: core input: open of rtsp://localhost:8554/video.ts' failed 08-09 10:52:35.823 6529-21339/com.compdigitec.libvlcandroidsample E/VLC: core input: Your input can't be opened 08-09 10:52:35.823 6529-21339/com.compdigitec.libvlcandroidsample E/VLC: core input: VLC is unable to open the MRL 'rtsp://localhost:8554/video.ts'
To prevent a session timeout, you must interact with the workbook. This might include navigation around the workbook, sorting, filtering, or any other activity that you do with the elements of the workbook. When the server detects user interaction with the workbook, it keeps the session active.
Session timeout represents the event occuring when a user does not perform any action on a web site during an interval (defined by a web server). The event, on the server side, changes the status of the user session to 'invalid' (ie.
The session inactivity timeout setting represents the amount of time a user can be inactive before the user's session times out and closes. It only affects user browser sessions. You can set the values from 5 minutes to 60 minutes. This function has a default value of 30 minutes.
Typical session timeouts are 15- to 45-minute durations depending on the sensitivity of the data that may be exposed.
The demux error you are getting is happening at a higher level in the stack. You need to first validate that the underlying SSH connection is still good. To do so, check and if necessary reconnect when your application resumes:
public void onResume() {
if (!session.isConnected()) {
reconnect(); // needs to create a new session, open a channel, etc.
}
}
Once you have validated the SSH connection, you should be able to resume the stream via LibVLC. If however you still see an error at that point, you'll have to show the code that you use to open / resume the stream.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With