diff --git a/materialious/src/lib/ShareVideo.svelte b/materialious/src/lib/ShareVideo.svelte new file mode 100644 index 00000000..b16d2f4a --- /dev/null +++ b/materialious/src/lib/ShareVideo.svelte @@ -0,0 +1,33 @@ + + +{#if !Capacitor.isNativePlatform()} + + await navigator.clipboard.writeText(`${location.origin}watch/${video.videoId}`)} + > +
{$_('player.share.materialiousLink')}
+{/if} + + await navigator.clipboard.writeText(`https://redirect.invidious.io/watch?v=${video.videoId}`)} +> +
{$_('player.share.invidiousRedirect')}
+ await navigator.clipboard.writeText(`https://www.youtube.com/watch?v=${video.videoId}`)} +> +
{$_('player.share.youtubeLink')}
diff --git a/materialious/src/lib/Thumbnail.svelte b/materialious/src/lib/Thumbnail.svelte index f1cd2b1b..98afb77f 100644 --- a/materialious/src/lib/Thumbnail.svelte +++ b/materialious/src/lib/Thumbnail.svelte @@ -1,5 +1,5 @@ -
(showVideoPreview = false)} - on:focus={() => {}} - role="region" -> - (showVideoPreview = false)} + on:focus={() => {}} + role="region" > - {#if loading} - - {:else if loaded} - {#if showVideoPreview && videoPreview} -
- -
- {:else} - Thumbnail for video - {/if} - {:else} -

{$_('thumbnail.failedToLoadImage')}

- {/if} - {#if progress} - - {/if} - {#if !('liveVideo' in video) || !video.liveVideo} - {#if video.lengthSeconds !== 0} -
-  {videoLength(video.lengthSeconds)}  -
- {/if} - {:else} -
- {$_('thumbnail.live')} -
- {/if} -
- {#if showVideoPreview && videoPreview} - - {/if} -
- -
- -
+ + {#if showVideoPreview && videoPreview} + + {/if} + + +
+ +
+{/if} diff --git a/materialious/src/lib/VideoList.svelte b/materialious/src/lib/VideoList.svelte index 729b7b01..d2d50f9d 100644 --- a/materialious/src/lib/VideoList.svelte +++ b/materialious/src/lib/VideoList.svelte @@ -1,21 +1,29 @@
{#each videos as video} -
-
- -
-
+ {#if !hiddenVideos.includes(video.videoId)} +
+
+ (hiddenVideos = [...hiddenVideos, video.videoId])} + {video} + {playlistId} + /> +
+
+ {/if} {/each}
diff --git a/materialious/src/lib/i18n/locales/en.json b/materialious/src/lib/i18n/locales/en.json index 59748fb7..bb1a1542 100644 --- a/materialious/src/lib/i18n/locales/en.json +++ b/materialious/src/lib/i18n/locales/en.json @@ -11,6 +11,7 @@ "deleteAllHistory": "Delete all history", "skipping": "Skipping", "replies": "replies", + "hideVideo": "Hide video", "syncParty": { "userJoined": "User joined your watch party.", "userLeft": "User left your watch party." @@ -116,4 +117,4 @@ } }, "subscribe": "Subscribe" -} +} \ No newline at end of file diff --git a/materialious/src/routes/watch/[slug]/+page.svelte b/materialious/src/routes/watch/[slug]/+page.svelte index 6b5fab9a..5f721cec 100644 --- a/materialious/src/routes/watch/[slug]/+page.svelte +++ b/materialious/src/routes/watch/[slug]/+page.svelte @@ -12,10 +12,10 @@ import type { Comments, PlaylistPage, PlaylistPageVideo } from '$lib/Api/model.js'; import Comment from '$lib/Comment.svelte'; import Player from '$lib/Player.svelte'; + import ShareVideo from '$lib/ShareVideo.svelte'; import Thumbnail from '$lib/Thumbnail.svelte'; import { cleanNumber, getBestThumbnail, numberWithCommas, unsafeRandomItem } from '$lib/misc'; import type { PlayerEvents } from '$lib/player'; - import { Capacitor } from '@capacitor/core'; import type { DataConnection } from 'peerjs'; import { onDestroy, onMount } from 'svelte'; import { _ } from 'svelte-i18n'; @@ -468,38 +468,8 @@ {$_('player.share.title')} - {#if !Capacitor.isNativePlatform()} - - await navigator.clipboard.writeText( - `${location.origin}watch/${data.video.videoId}` - )} - > -
{$_('player.share.materialiousLink')}
- {/if} - - 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}