Refactoring

This commit is contained in:
Alexey Khit
2022-11-08 00:37:13 +03:00
parent ea18475d31
commit 717af29630
2 changed files with 6 additions and 4 deletions
+4 -4
View File
@@ -25,12 +25,12 @@
<body>
<video id="video" autoplay controls playsinline muted></video>
<script>
const baseUrl = location.origin + location.pathname.substr(
0, location.pathname.lastIndexOf("/")
);
function init(stream) {
// support api_path
const baseUrl = location.origin + location.pathname.substr(
0, location.pathname.lastIndexOf("/")
);
const ws = new WebSocket(`ws${baseUrl.substr(4)}/api/ws${location.search}`);
ws.onopen = () => {
console.debug('ws.onopen');