Fix embed

This commit is contained in:
WardPearce
2025-04-02 16:10:27 +13:00
parent ae77468933
commit adb94a475f
3 changed files with 6 additions and 6 deletions
-1
View File
@@ -119,7 +119,6 @@ Deploy Materialious for your Invidious instance using Docker. Follow the steps o
- [SecularSteve](https://github.com/SecularSteve) for creating Materialious' logo.
- [Invidious](https://github.com/iv-org)
- [Clipious](https://github.com/lamarios/clipious) for inspiration & a good source for learning more about undocumented Invidious routes.
- [Vidstack player](https://github.com/vidstack/player)
- [Beer CSS](https://github.com/beercss/beercss) (Especially the [YouTube template](https://github.com/beercss/beercss/tree/main/src/youtube) what was used as the base for Materialious.)
- Every dependency in [package.json](/materialious/package.json).
+4 -2
View File
@@ -71,6 +71,8 @@ export async function patchYoutubeJs(videoId: string): Promise<VideoPlay> {
const video = new YT.VideoInfo([rawPlayerResponse, rawNextResponse], youtube!.actions, '');
console.log(video);
if (!video.primary_info || !video.secondary_info) {
throw new Error('Yt.js: Unable to pull video info from youtube.js');
}
@@ -151,8 +153,8 @@ export async function patchYoutubeJs(videoId: string): Promise<VideoPlay> {
return {
type: 'video',
title: video.primary_info.title?.toString() || '',
viewCount: Number(video.primary_info.view_count?.original_view_count || 0),
viewCountText: video.primary_info.view_count?.original_view_count.toString() || '0',
viewCount: Number(video.basic_info.view_count || 0),
viewCountText: video.basic_info.view_count?.toString() || '0',
likeCount: video.basic_info.like_count || 0,
dislikeCount: 0,
allowRatings: false,
@@ -1,10 +1,9 @@
<script lang="ts">
import Player from '$lib/components/Player.svelte';
import type { MediaPlayerElement } from 'vidstack/elements';
let { data } = $props();
let player: MediaPlayerElement;
let playerElement: HTMLMediaElement;
</script>
<Player bind:player isEmbed={true} {data} />
<Player bind:playerElement isEmbed={true} {data} />