openvidu-java-client: allow http and https URI protocols on rtspUri parameter

pull/750/head
pabloFuente 2022-10-04 13:11:36 +02:00
parent f886eb217c
commit 4e299f1ae6
2 changed files with 7 additions and 1 deletions

View File

@ -684,7 +684,7 @@ public class ConnectionProperties {
public static URI checkRtspUri(String rtspUri) throws MalformedURLException {
try {
URI uri = new URI(rtspUri);
List<String> allowedSchemes = Arrays.asList("file", "rtsp", "rtsps");
List<String> allowedSchemes = Arrays.asList("file", "rtsp", "rtsps", "http", "https");
if (!allowedSchemes.contains(uri.getScheme())) {
throw new MalformedURLException(
"RTSP URI does not contain a valid protocol " + allowedSchemes.toString());

View File

@ -51,6 +51,12 @@ public class ConnectionPropertiesTest extends TestCase {
jsonString = "{'type':'IPCAM','rtspUri':'file://your.camera.ip.sdp'}";
ConnectionProperties.fromJson(mapFromJsonString(jsonString)).build();
jsonString = "{'type':'IPCAM','rtspUri':'http://your.camera.ip.sdp'}";
ConnectionProperties.fromJson(mapFromJsonString(jsonString)).build();
jsonString = "{'type':'IPCAM','rtspUri':'https://your.camera.ip.sdp'}";
ConnectionProperties.fromJson(mapFromJsonString(jsonString)).build();
}
public void testFromJsonError() {