Refactoring

This commit is contained in:
Alexey Khit
2022-11-07 23:36:24 +03:00
parent ea18475d31
commit 717af29630
2 changed files with 6 additions and 4 deletions
+2
View File
@@ -53,3 +53,5 @@ pc.ontrack = ev => {
- https://www.webrtc-experiment.com/DetectRTC/
- https://divtable.com/table-styler/
- https://www.chromium.org/audio-video/
- https://web.dev/i18n/en/fast-playback-with-preload/#manual_buffering
- https://developer.mozilla.org/en-US/docs/Web/API/Media_Source_Extensions_API
+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');