Verifying an RTSP Stream [Andriod]

15 views Asked by At

first post on stack overflow! I was wondering if anyone was aware of how to verify an RTSP Stream on andriod. Currently I have an implementation where I use libvlc to play the stream and sleep the thread for 10 seconds and see if libvlc got anything, but I noticed this is very hit or miss. Meaning sometimes it work and other times it doesn't. Please share any insight you may have or if there is perhaps an alternative. I have noticed unlike http rtsp you can't really ping, which has kinda been a big let down.Thank you!

This is my current sometimes working solution I attempted to put together.

val vLib = LibVLC(appContext)     
val stream = Media(vLib, <StringLinkToRTSPStream>)      
var player: MediaPlayer? = MediaPlayer(vLib)      
player!!.media =stream      
player.play()      
// bad, pratice, but inserted for pause      
Thread.sleep(10000)      
val rslt = player.isPlaying      
player.stop()      
vLib.release()      
stream.release()      
return rslt
0

There are 0 answers