Skip to content
This repository was archived by the owner on Oct 25, 2024. It is now read-only.

Commit 5bc9514

Browse files
starwarfanlzhai
authored andcommitted
Fix error when adding rtsp stream in url (#127)
1 parent b5bc4d2 commit 5bc9514

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/samples/conference/public/scripts/rest-sample.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ var generateUrl = function(host, path) {
2727
if (host !== undefined) {
2828
url = host + path; // Use the host user set.
2929
}else {
30-
let index = document.URL.lastIndexOf('\/');
31-
url = document.URL.substring(0, index) + path; // Get the string before last '/'.
30+
let u = new URL(document.URL);
31+
url = u.origin + path; // Get the string before last '/'.
3232
}
3333
return url;
3434
}

0 commit comments

Comments
 (0)