mirror of https://github.com/OpenVidu/openvidu.git
openvidu-java-client: allow http and https URI protocols on rtspUri parameter
parent
f886eb217c
commit
4e299f1ae6
|
@ -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());
|
||||
|
|
|
@ -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() {
|
||||
|
|
Loading…
Reference in New Issue