diff --git a/materialious/src/routes/watch/[slug]/+page.svelte b/materialious/src/routes/watch/[slug]/+page.svelte index 9922eb10..a8623fda 100644 --- a/materialious/src/routes/watch/[slug]/+page.svelte +++ b/materialious/src/routes/watch/[slug]/+page.svelte @@ -10,13 +10,12 @@ } from '$lib/Api/index.js'; import type { PlaylistPage, PlaylistPageVideo } from '$lib/Api/model.js'; import Comment from '$lib/Comment.svelte'; - import PageLoading from '$lib/PageLoading.svelte'; import Player from '$lib/Player.svelte'; import Thumbnail from '$lib/Thumbnail.svelte'; import { cleanNumber, numberWithCommas } from '$lib/misc.js'; import type { PlayerEvents } from '$lib/player'; import type { DataConnection } from 'peerjs'; - import { onMount } from 'svelte'; + import { onDestroy, onMount } from 'svelte'; import { _ } from 'svelte-i18n'; import { get } from 'svelte/store'; import type { MediaPlayerElement } from 'vidstack/elements'; @@ -239,6 +238,11 @@ } }); + onDestroy(() => { + // Reset title when page left. + document.title = 'Materialious'; + }); + async function loadPlaylist(playlistId: string) { for (let page = 1; page < Infinity; page++) { const newPlaylist = await getPlaylist(playlistId, page); @@ -302,257 +306,253 @@ } -{#if data} -
-
- {#key data.video.videoId} - - {/key} + + {data.video.title} | Materialious + -
{data.video.title}
+
+
+ {#key data.video.videoId} + + {/key} -
-
- -
-
- {#if data.returnYTDislikes} - - {/if} +
{data.video.title}
-
- - - - {#if data.downloadOptions.length > 0} - - {/if} - {#if data.personalPlaylists} - - {:else} - - {/if} -
-
-
- -
-
- + -
-
-
- {@html data.content.description} + + {#if $auth} + + {:else} + + {/if} + +
+
+ {#if data.returnYTDislikes} + + {/if} + +
+ + + + + await navigator.clipboard.writeText( + `${import.meta.env.VITE_DEFAULT_FRONTEND_URL}/watch/${data.video.videoId}` + )} + > +
{$_('player.share.materialiousLink')}
+ await navigator.clipboard.writeText( + `https://redirect.invidious.io/watch?v=${data.video.videoId}` + )} + > +
{$_('player.share.invidiousRedirect')}
+ await navigator.clipboard.writeText( + `https://www.youtube.com/watch?v=${data.video.videoId}` + )} + > +
{$_('player.share.youtubeLink')}
+ {#if data.downloadOptions.length > 0} +
-
-
- -
- {#if comments !== null && comments.comments !== undefined && comments.comments.length > 0} -
{numberWithCommas(comments.commentCount)} comments
- {#each comments.comments as comment} - - {/each} - {#if comments.continuation} - - {/if} - {:else} -
{$_('player.unableToLoadComments')}
- {/if} -
- {#if !theatreMode} -
- {#if !playlist} - {#if data.video.recommendedVideos} - {#each data.video.recommendedVideos as recommendedVideo} -
- {#key recommendedVideo.videoId} - - {/key} -
- {/each} + {/if} - {:else} -
-
-
{playlist.title}
-

- {cleanNumber(playlist.viewCount)} - {$_('views')} • {playlist.videoCount} - {$_('videos')} -

-

{playlist.author}

-
-
- -
- - {#each playlistVideos as playlistVideo} -
- -
- {/each} -
- {/if} + {#if data.personalPlaylists} + + {:else} + + {/if} +
+
+ +
+
+ + + +
+
+
+ {@html data.content.description} +
+ {#if data.content} + {#if data.content.timestamps.length > 0} +
Chapters
+ {#each data.content.timestamps as timestamp} + + {/each} + {/if} + {/if} +
+
+
+ +
+ {#if comments !== null && comments.comments !== undefined && comments.comments.length > 0} +
{numberWithCommas(comments.commentCount)} comments
+ {#each comments.comments as comment} + + {/each} + {#if comments.continuation} + + {/if} + {:else} +
{$_('player.unableToLoadComments')}
{/if}
-{:else} - -{/if} + {#if !theatreMode} +
+ {#if !playlist} + {#if data.video.recommendedVideos} + {#each data.video.recommendedVideos as recommendedVideo} +
+ {#key recommendedVideo.videoId} + + {/key} +
+ {/each} + {/if} + {:else} +
+
+
{playlist.title}
+

+ {cleanNumber(playlist.viewCount)} + {$_('views')} • {playlist.videoCount} + {$_('videos')} +

+

{playlist.author}

+
+
+ +
+ + {#each playlistVideos as playlistVideo} +
+ +
+ {/each} +
+ {/if} +
+ {/if} +