add body js

This commit is contained in:
Roy Olav Purser 2021-05-14 13:00:16 +02:00
parent 77ab3e38df
commit ed05306e6c
Signed by: roypur
GPG Key ID: E14D26A036F21656

View File

@ -1,7 +1,5 @@
(() => { (() => {
let url = new URL("{{ stream }}", window.location.origin); let upstream = "{{ stream }}";
let upstream = url.href;
let xhr = new XMLHttpRequest(); let xhr = new XMLHttpRequest();
xhr.open("HEAD", upstream, true); xhr.open("HEAD", upstream, true);
xhr.send(); xhr.send();
@ -16,6 +14,7 @@
let handle = () => { let handle = () => {
let bodies = document.getElementsByTagName("body"); let bodies = document.getElementsByTagName("body");
if(bodies.length === 1) { if(bodies.length === 1) {
let body = bodies[0];
let video = document.createElement("video"); let video = document.createElement("video");
video.className = "video-js vjs-big-play-centered"; video.className = "video-js vjs-big-play-centered";
body.appendChild(video); body.appendChild(video);