I\'m trying to watch RTSP streaming on Android device. But if the server set password for the streaming my Android cannot play it. If without password it\'s ok. Here is my codes
I'm developing the RTSP related code just like you, and I found the following conclusions:
But with the authentication you mentioned, if your camera use HTTP basic auth, you need to add header in http request:, ex(I use OKHTTP 2.0):
String basicAuth = Credentials.basic("account", "pass"); Request request = new Request.Builder().url(url).header("Authorization", basicAuth).build(); Response response = client.newCall(request).execute();
That works for me! Hope it's helpful for you.