This commit is contained in:
Korbs 2024-10-28 23:36:22 -04:00
parent 18a0a7e6e2
commit fdb30540db
2 changed files with 46 additions and 10 deletions

View file

@ -61,11 +61,11 @@ let { data: subs } = await supabase
<div class="sidebar-top-start">
<a href='/'><img src="/images/logo/MinPluto - Logo.png"/></a>
<div>
{Guest ?
<!-- {Guest ?
<a title="Login" href="/login"><LogIn/></a>
:
<a title="Log Out" href="/api/auth/logout"><LogOut/></a>
}
} -->
<a title="Settings" href="#"><Settings/></a>
</div>
</div>

View file

@ -2,14 +2,51 @@
import { t, changeLanguage } from "i18next";
import Embed from "@layouts/Embed.astro";
import "@styles/video.scss";
// Configuration
import { DEFAULT_MEDIA_DATA_PROXY, DEFAULT_IMAGE_PROXY, SERVER_DOMAIN } from '@utils/GetConfig'
// Components
import { Zorn } from "@minpluto/zorn"
// Fetch
const SWV = Astro.url.href.split("embed/").pop();
const video = await fetch(DEFAULT_MEDIA_DATA_PROXY + "/api/v1/videos/" + SWV).then((response) => response.json());
// Quality Check
const EightKCheck = await fetch(DEFAULT_MEDIA_DATA_PROXY + '/latest_version?id=' + video.videoId + '&itag=571')
if (EightKCheck.status == 200) {
var EightK = true
} else {
var EightK = false
}
const FourKCheck = await fetch(DEFAULT_MEDIA_DATA_PROXY + '/latest_version?id=' + video.videoId + '&itag=313')
if (FourKCheck.status == 200) {
var FourK = true
} else {
var FourK = false
}
const TenEightyCheck = await fetch(DEFAULT_MEDIA_DATA_PROXY + '/latest_version?id=' + video.videoId + '&itag=303')
if (TenEightyCheck.status == 200) {
var TenEighty = true
} else {
var TenEighty = false
}
const ThreeSixtyCheck = await fetch(DEFAULT_MEDIA_DATA_PROXY + '/latest_version?id=' + video.videoId + '&itag=134')
if (ThreeSixtyCheck.status == 200) {var ThreeSixty = true}
if (EightK === true) { // 571
var Quality = '571'
} else if (FourK === true) { // 313
var Quality = '313'
} else if (TenEighty === true) { // 137
var Quality = '303'
} else if (ThreeSixty === true) { // 134
var Quality = '134'
}
---
<Embed
@ -20,14 +57,13 @@ const video = await fetch(DEFAULT_MEDIA_DATA_PROXY + "/api/v1/videos/" + SWV).th
EmbedTitle={video.title}
>
<div class="video-container">
<video
class="zorn-player"
autoplay
poster={DEFAULT_IMAGE_PROXY + '/https://i.ytimg.com/vi/' + video.videoId + '/maxresdefault.jpg'}
video-title={video.title}
src={DEFAULT_MEDIA_DATA_PROXY + '/latest_version?id=' + video.videoId + '&itag=22&local=true'}
>
</video>
<Zorn
Poster={DEFAULT_IMAGE_PROXY + '/https://i.ytimg.com/vi/' + video.videoId + '/maxresdefault.jpg'}
Video={DEFAULT_MEDIA_DATA_PROXY + '/latest_version?id=' + video.videoId + '&itag=' + Quality + '&local=true'}
Audio={DEFAULT_MEDIA_DATA_PROXY + '/latest_version?id=' + video.videoId + '&itag=140'}
VideoAttributes="muted"
AudioAttributes=""
/>
</div>
</Embed>