Allow JS player URL to http
This commit is contained in:
+4
-5
@@ -188,12 +188,11 @@ class VideoRTC extends HTMLElement {
|
|||||||
* @param {string|URL} value
|
* @param {string|URL} value
|
||||||
*/
|
*/
|
||||||
set src(value) {
|
set src(value) {
|
||||||
if (typeof value === "string") {
|
if (typeof value !== "string") value = value.toString();
|
||||||
if (value.startsWith("/")) {
|
if (value.startsWith("http")) {
|
||||||
value = "ws" + location.origin.substring(4) + value;
|
|
||||||
} else if (value.startsWith("http")) {
|
|
||||||
value = "ws" + value.substring(4);
|
value = "ws" + value.substring(4);
|
||||||
}
|
} else if (value.startsWith("/")) {
|
||||||
|
value = "ws" + location.origin.substring(4) + value;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.url = value;
|
this.url = value;
|
||||||
|
|||||||
Reference in New Issue
Block a user