Spaces:
Running
Running
File size: 7,077 Bytes
b75837d 573d850 b75837d 2e90335 b75837d 573d850 b75837d 2e90335 b75837d 2e90335 542c147 2e90335 573d850 b75837d 2e90335 b75837d 2e90335 542c147 2e90335 b75837d 2e90335 b75837d 2e90335 573d850 b75837d 573d850 2e90335 573d850 b75837d |
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 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 |
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="preconnect" href="https://rsms.me/">
<link rel="stylesheet" href="https://rsms.me/inter/inter.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/daydreamer-json/SomeFontRepo@main/somefontrepo.css">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Noto+Sans+JP:wght@100;200;300;400;500;600;700;800;900&display=swap" rel="stylesheet">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/vidstack@^1.0.0/player/styles/default/theme.min.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/vidstack@^1.0.0/player/styles/default/layouts/video.min.css">
<script src="https://cdn.jsdelivr.net/npm/vidstack@^1.0.0/cdn/with-layouts/vidstack.js" type="module"></script>
<script src='https://unpkg.com/bignumber.js'></script>
<script src='https://unpkg.com/cbor-web'></script>
<style>
:root { font-family: 'Inter', sans-serif; }
@supports (font-variation-settings: normal) {
:root { font-family: 'Inter var', sans-serif; }
}
body {
margin: 0;
background-color: #000000;
width: 100vw;
height: 100vh;
font-family: 'Inter', 'Noto Sans JP', sans-serif;
}
.wrapper {
height: 100vh;
display: flex;
flex-direction: column;
}
#player {
flex-grow: 1;
top: 0;
left: 0;
height: 100%;
width: 100%;
font-family: 'Inter', 'Noto Sans JP', sans-serif;
overflow: hidden;
}
.vds-video-layout {
--video-font-family: 'Inter', 'Noto Sans JP', sans-serif !important;
--video-border-radius: 0px !important;
--video-border: 0px !important;
}
:where([data-media-provider], video, media-poster) {
border-radius: var(--video-border-radius);
border: var(--video-border);
}
:where([data-media-player][data-view-type=video]:not([data-fullscreen])) {
border-radius: var(--video-border-radius);
border: var(--video-border);
}
:where([data-media-player][data-view-type=video]) {
border-radius: var(--video-border-radius);
border: var(--video-border);
}
[data-media-provider] video {
width: 100%;
height: 100%;
object-fit: contain;
}
media-captions {
/* font-family: 'SDK_JP_Web', sans-serif; */
font-family: 'Inter', 'Noto Sans JP', sans-serif;
text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.75), -1px 1px 0 rgba(0, 0, 0, 0.75), 1px -1px 0 rgba(0, 0, 0, 0.75), -1px -1px 0 rgba(0, 0, 0, 0.75);
}
footer.copyrightDisp {
position: fixed;
left: 0;
bottom: 0;
padding: 0;
margin: 0 0 10px 10px;
color: #ffffff80;
z-index: 2;
user-select: none;
}
</style>
</head>
<body>
<div class="wrapper">
<media-player
title=""
aspect-ratio="16/9"
crossorigin
id="player"
>
<media-provider id="player-media-outlet-el">
</media-provider>
<media-audio-layout></media-audio-layout>
<media-video-layout></media-video-layout>
</media-player>
</div>
<script>
window.addEventListener('load', async function(){
// const cbor = require('cbor-web');
window.uiTranslation = {
"ja-JP": {
"Audio": "音声",
"Auto": "自動",
"Captions": "字幕",
"Chapters": "チャプター",
"Default": "既定",
"Mute": "ミュート",
"Normal": "標準",
"Off": "オフ",
"Pause": "一時停止",
"Play": "再生",
"Speed": "速度",
"Quality": "画質",
"Settings": "設定",
"Unmute": "ミュート解除",
"Seek Forward": "進む",
"Seek Backward": "戻る",
"Closed-Captions On": "字幕オン",
"Closed-Captions Off": "字幕オフ",
"Enter Fullscreen": "全画面表示",
"Exit Fullscreen": "全画面表示を終了",
"Enter PiP": "PiP",
"Exit PiP": "PiPを終了"
}
};
// uiTranslation.cbor.ja = atob(uiTranslation.base64.ja);
// uiTranslation.json.ja = await cbor.decodeFirst(uiTranslation.cbor.ja);
document.oncontextmenu = function () {return false;}
window.player = document.querySelector('media-player');
for (let i = 0; i < Object.keys(uiTranslation).length; i++) {
if (window.navigator.language == Object.keys(uiTranslation)[i]) {
document.querySelector('media-video-layout').translations = uiTranslation[Object.keys(uiTranslation)[i]];
}
}
const pageUrlLocationHref = new URL(location.href);
const pageSearchParams = pageUrlLocationHref.searchParams;
if (pageSearchParams.has("url") === true && pageSearchParams.get("url") !== "") {
attachSourceToPlayer(pageSearchParams.get("url"));
if (pageSearchParams.has("subtitle") === true && pageSearchParams.get("subtitle") !== "") {
attachSubtitleSourceToPlayer(pageSearchParams.get("subtitle"));
}
} else {
const promptedUrl = prompt("Please input source URL");
if (promptedUrl === "") {
alert("Source not found");
} else {
attachSourceToPlayer(promptedUrl);
}
}
player.addEventListener('provider-change', (event) => {
const provider = event.detail;
if (provider?.type === 'hls') {
provider.library = 'https://cdn.jsdelivr.net/npm/[email protected]/dist/hls.min.js';
provider.config = {
"debug": true,
"enableWorker": true,
"lowLatencyMode": true,
"backBufferLength": 90
};
window.provider = provider;
}
});
});
function attachSourceToPlayer (url) {
player.src = url;
player.title = url.match(/^(?:[^:\/?#]+:)?(?:\/\/[^\/?#]*)?(?:([^?#]*\/)([^\/?#]*))?(\?[^#]*)?(?:#.*)?$/)[2].match(/^(.+?)(\.[^.]+)?$/)[1];
}
function attachSubtitleSourceToPlayer (url) {
const outletElement = document.querySelector('#player-media-outlet-el');
const trackElement = document.createElement("track");
trackElement.src = url;
trackElement.kind = "subtitles";
trackElement.label = "Subtitle";
outletElement.appendChild(trackElement);
}
</script>
</body>
</html> |