-
Notifications
You must be signed in to change notification settings - Fork 1
/
watch.html
39 lines (31 loc) · 881 Bytes
/
watch.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
<style>
body {
margin: 0px;
background-color: black;
}
</style>
<video
style="width: 100vw; height: 100vh"
id="video"
controls
preload="metadata"
></video>
<script>
let searchParamsString = window.location.search.substring(
1,
window.location.search.length
);
let searchParams = {};
let searchParamsArray = searchParamsString.split("&");
console.log({ searchParamsArray });
searchParamsArray.forEach((fullParam) => {
let [paramName, paramValue] = fullParam.split("=");
searchParams[paramName] = paramValue;
});
console.log({ searchParams });
let videoElement = document.querySelector("video#video");
videoElement.innerHTML = `
<source src="/video/${searchParams.filmPath}" type="video/mp4" />
<track label="English" kind="subtitles" srclang="en" src="/sub/${searchParams.subPath}" default />
`;
</script>