Compare commits

..

3 commits

Author SHA1 Message Date
Korbs
b29039f07b update 2024-09-07 04:03:15 -04:00
Korbs
ff0c6f5a1d Install the official Zorn player 2024-09-07 04:03:10 -04:00
Korbs
c39e006b5c Replace player with official Zorn and check if comments are enabled or not 2024-09-07 04:03:03 -04:00
4 changed files with 31 additions and 19 deletions

BIN
bun.lockb

Binary file not shown.

View file

@ -36,6 +36,7 @@
"@astrojs/node": "^8.3.2",
"@astrojs/vue": "^4.5.0",
"@iconoir/vue": "^7.8.0",
"@minpluto/zorn": "^0.4.5",
"@nurodev/astro-bun": "^1.1.5",
"@openpanel/sdk": "^0.0.9-beta",
"@supabase/supabase-js": "^2.45.1",

1
source/src/env.d.ts vendored
View file

@ -1 +1,2 @@
/// <reference path="../.astro/types.d.ts" />
/// <reference types="astro/client" />

View file

@ -1,15 +1,16 @@
---
import { t, changeLanguage } from "i18next";
import Base from "@layouts/Default.astro";
import "@styles/video.scss";
import { t, changeLanguage } from "i18next"
import Base from "@layouts/Default.astro"
import "@styles/video.scss"
// Configuration
import { DEFAULT_MEDIA_PROXY, DEFAULT_MEDIA_DATA_PROXY, DEFAULT_IMAGE_PROXY, SERVER_DOMAIN } from '@utils/GetConfig'
import { Donate, Download, ShareIos, ThumbsUp, MediaVideo } from "@iconoir/vue";
import { Donate, Download, ShareIos, ThumbsUp, MediaVideo } from "@iconoir/vue"
// Components
import Dialog from '@components/Dialog.astro'
import Video from '@components/VideoItem.astro'
import Player from "@components/video-player/Player.astro";
import { Zorn } from "@minpluto/zorn"
// Fetch
const SWV = Astro.url.href.split("watch?v=").pop();
@ -21,6 +22,15 @@ const Views = video.viewCount;
const VideoSeconds = video.lengthSeconds;
let DescriptionFormat = Description.replaceAll("\n", " <br/> ");
var CheckComments = console.log(comments) // If not found, disable comment section
if (CheckComments = "{ error: 'Comments not found.' }") {
var EnableComments = false
} else {
var EnableComments = true
}
// Format Published Date
const DateFormat = new Date(UploadDate * 1000).toLocaleDateString();
@ -74,10 +84,12 @@ if (EightK === true) { // 571
---
<Base Title={video.title}>
<Player
<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 class="video-rea">
<div class="rea-details">
@ -108,26 +120,24 @@ if (EightK === true) { // 571
<div style="display: flex; gap: 24px;">
<div class="rea-comments">
<h2>{t("WATCH.COMMENTS")}</h2>
{
{EnableComments ?
comments.comments.map((comment) => (
<div class="comment">
<img
src={
DEFAULT_IMAGE_PROXY + "/" + comment.authorThumbnails[0].url
}
/>
<img src={DEFAULT_IMAGE_PROXY + "/" + comment.authorThumbnails[0].url}/>
<div>
<p>
<a href={comment.authorUrl}>{comment.author}</a> - 2 Months
Ago
</p>
<p><a href={comment.authorUrl}>{comment.author}</a> - 2 Months Ago</p>
<p>{comment.contentHtml}</p>
<p>
<ThumbsUp /> {comment.likeCount}
</p>
<p><ThumbsUp /> {comment.likeCount}</p>
</div>
</div>
))
:
<p>Comments are disabled on this video.</p>
<style is:global>
.rea-comments {
width: 100%;
}
</style>
}
</div>
<div class="rea-recommendations">