My task is to create an android application in android to check some IP cameras of the city. Using the existing RTSP url which is rtsp://admin:pms7112@xxx.xx.xx.xxx:554/cam/realmonitor?channel=1&subtype=0 I can get the stream in VLC player but no luck in android. I have tried videoview native player and media player
.
Almost every solution gave me
MediaPlayer: setDataSource IOException happend : java.io.FileNotFoundException: No content provider: rtsp://...
Should this problem happen because the username and password is in the string
? how could you add the username and password as query string
?
EDIT
Mediaplayer version
MediaPlayer mediaPlayer = new MediaPlayer();
try
{
mediaPlayer.setDataSource("rtsp://admin:pms7112@iphere:554/cam/realmonitor?channel=1&subtype=0");
mediaPlayer.prepare();
mediaPlayer.start();
}
catch (IOException ex)
{
ex.printStackTrace();
}
Update:
So...it seems that this is the only way I could use the url...I cannot authenticate the user other way. The conpany which owns the camera and setted up for the city do not let us to use other formats. They said, vlc browser addon plays just fine and they will not change anything... So is there any library that implements the rtsp stream with authentication. I heard about a handshake that is made between the client and the server