meta template
This commit is contained in:
@ -1,17 +1,7 @@
|
||||
<html>
|
||||
<head>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<meta property="og:title" content="{{ data["og:title"] }}" />
|
||||
<meta property="og:description" content="{{ data["og:description"] }}" />
|
||||
<meta property="og:type" content="video.other" />
|
||||
<meta property="og:image" content="{{ data["og:image"] }}" />
|
||||
<meta property="og:image:height" content="{{ data["og:image:height"] }}" />
|
||||
<meta property="og:image:width" content="{{ data["og:image:width"] }}" />
|
||||
<meta property="og:url" content="{% raw data["render_url"] %}" />
|
||||
<meta property="og:video:url" content="{% raw data["render_url"] %}" />
|
||||
<meta property="og:video:secure_url" content="{% raw data["stream_url"] %}" />
|
||||
<meta property="og:video:height" content="{{ data["og:video:height"] }}" />
|
||||
<meta property="og:video:width" content="{{ data["og:video:width"] }}" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">{% for item in meta %}
|
||||
{% block item %}<meta property="{{ item[0] }}" content="{{ item[1] }}" />{% end %}{% end %}
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/video.js/{{ data["videojs_version"] }}/video-js.css">
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@silvermine/videojs-chromecast@{{ data["chromecast_version"] }}/dist/silvermine-videojs-chromecast.css">
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/video.js/{{ data["videojs_version"] }}/video.min.js"></script>
|
||||
|
@ -1,12 +1,21 @@
|
||||
let url = new URL("{{ stream }}", window.location.origin);
|
||||
let upstream = url.href;
|
||||
(() => {
|
||||
let url = new URL("{{ stream }}", window.location.origin);
|
||||
let upstream = url.href;
|
||||
|
||||
document.addEventListener("DOMContentLoaded", () => {
|
||||
let bodies = document.getElementsByTagName("body");
|
||||
if(bodies.length === 1) {
|
||||
let body = bodies[0];
|
||||
let xhr = new XMLHttpRequest();
|
||||
xhr.addEventListener("load", () => {
|
||||
let xhr = new XMLHttpRequest();
|
||||
xhr.open("HEAD", upstream, true);
|
||||
xhr.send();
|
||||
|
||||
let count = 2;
|
||||
let handleCount = () => {
|
||||
if(--count === 0) {
|
||||
handle();
|
||||
}
|
||||
}
|
||||
|
||||
let handle = () => {
|
||||
let bodies = document.getElementsByTagName("body");
|
||||
if(bodies.length === 1) {
|
||||
let video = document.createElement("video");
|
||||
video.className = "video-js vjs-big-play-centered";
|
||||
body.appendChild(video);
|
||||
@ -25,8 +34,9 @@ document.addEventListener("DOMContentLoaded", () => {
|
||||
source.type = ctype;
|
||||
source.src = upstream;
|
||||
player.src(source);
|
||||
});
|
||||
xhr.open("HEAD", upstream, true);
|
||||
xhr.send();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
document.addEventListener("DOMContentLoaded", handleCount);
|
||||
xhr.addEventListener("load", handleCount);
|
||||
})();
|
||||
|
Reference in New Issue
Block a user