diff --git a/materialious/src/lib/Player.svelte b/materialious/src/lib/Player.svelte index 75f41b2f..33702fcc 100644 --- a/materialious/src/lib/Player.svelte +++ b/materialious/src/lib/Player.svelte @@ -123,6 +123,9 @@ event.detail.currentTime >= segment.startTime && event.detail.currentTime <= segment.endTime ) { + if (Math.round(player.currentTime) >= Math.round(player.duration)) { + return; + } categoryBeingSkipped = segment.category; player.currentTime = segment.endTime + 1; ui('#sponsorblock-alert'); diff --git a/materialious/src/routes/+layout.svelte b/materialious/src/routes/+layout.svelte index d79497b8..00da59b9 100644 --- a/materialious/src/routes/+layout.svelte +++ b/materialious/src/routes/+layout.svelte @@ -24,10 +24,12 @@ interfaceSearchSuggestions, playerAlwaysLoop, playerAutoPlay, + playerAutoplayNextByDefault, playerDash, playerListenByDefault, playerProxyVideos, playerSavePlaybackPosition, + playerTheatreModeByDefault, returnYTDislikesInstance, returnYtDislikes, sponsorBlock, @@ -405,7 +407,7 @@
+
+ +
+ +
+ +
+
diff --git a/materialious/src/routes/search/[slug]/+page.svelte b/materialious/src/routes/search/[slug]/+page.svelte index b96ee4d2..dd4410ae 100644 --- a/materialious/src/routes/search/[slug]/+page.svelte +++ b/materialious/src/routes/search/[slug]/+page.svelte @@ -1,7 +1,7 @@ {#if data}
-
+
{#key data.video.videoId} {/if} - - - {#if data.downloadOptions.length > 0} + +
+ + + await navigator.clipboard.writeText( + `${import.meta.env.VITE_DEFAULT_FRONTEND_URL}/watch/${data.video.videoId}` + )} + > +
Copy Materialious link
+ await navigator.clipboard.writeText( + `https://redirect.invidious.io/watch?v=${data.video.videoId}` + )} + > +
Copy Invidious redirect link
+ await navigator.clipboard.writeText( + `https://www.youtube.com/watch?v=${data.video.videoId}` + )} + > +
Copy Youtube link
- {/if} - {#if data.personalPlaylists} - - {:else} - - {/if} + {#if data.downloadOptions.length > 0} + + {/if} + {#if data.personalPlaylists} + + {:else} + + {/if} +
@@ -370,10 +414,7 @@ {#if data.content.timestamps.length > 0}
Chapters
{#each data.content.timestamps as timestamp} -
-
- {#if !data.playlistId} - {#if data.video.recommendedVideos} - {#each data.video.recommendedVideos as recommendedVideo} -
- {#key recommendedVideo.videoId} - - {/key} + {#if !theatreMode} +
+ {#if !data.playlistId} + {#if data.video.recommendedVideos} + {#each data.video.recommendedVideos as recommendedVideo} +
+ {#key recommendedVideo.videoId} + + {/key} +
+ {/each} + {/if} + {:else if playlist} +
+
+
{playlist.title}
+

{cleanNumber(playlist.viewCount)} views • {playlist.videoCount} videos

+

{playlist.author}

+
- {/each} - {/if} - {:else if playlist} -
-
-
{playlist.title}
-

{cleanNumber(playlist.viewCount)} views • {playlist.videoCount} videos

-

{playlist.author}

-
+ +
+ + {#each playlistVideos as playlistVideo} +
+ +
+ {/each}
- -
- - {#each playlistVideos as playlistVideo} -
- -
- {/each} -
- {/if} -
+ {/if} +
+ {/if} {:else} @@ -453,10 +500,16 @@ margin-left: 0; margin-bottom: 0.4em; display: block; - background-color: var(--secondary-container); + padding: 0; + text-align: left; + background-color: transparent; color: var(--on-secondary-container); } + .timestamps:hover { + padding: 0 0.5em; + } + .video-actions { display: flex; align-items: center; @@ -469,7 +522,25 @@ @media screen and (max-width: 1000px) { .video-actions { - justify-content: flex-start; + align-items: flex-start; + flex-direction: column; + } + } + + @media screen and (max-width: 1000px) { + .video-actions > div { + margin-top: 1em; + } + } + + @media screen and (max-width: 1000px) { + menu { + position: fixed; + top: 50%; + left: 50%; + width: 100%; + transform: translate(-50%, 50%); + background-color: var(--surface-variant); } } diff --git a/materialious/src/store.ts b/materialious/src/store.ts index 36b54d53..595c2023 100644 --- a/materialious/src/store.ts +++ b/materialious/src/store.ts @@ -15,6 +15,8 @@ export const playerProxyVideos = persisted("proxyVideos", false); export const playerListenByDefault = persisted("listenByDefault", false); export const playerSavePlaybackPosition = persisted("savePlaybackPosition", true); export const playerDash = persisted("dashEnabled", false); +export const playerTheatreModeByDefault = persisted("theatreModeByDefault", false); +export const playerAutoplayNextByDefault = persisted("autoplayNextByDefault", false); export const returnYtDislikes = persisted("returnYtDislikes", true); diff --git a/materialious/static/style.css b/materialious/static/style.css index 51fd4b99..9cd400b1 100644 --- a/materialious/static/style.css +++ b/materialious/static/style.css @@ -2,6 +2,20 @@ padding: .1em .4em; } +.vds-chapter-radio-label { + word-wrap: break-word !important; + overflow-wrap: break-word !important; + white-space: normal !important; +} + +.vds-chapter-radio-content { + max-width: 200px !important; +} + +.vds-chapter-radio { + align-items: start !important; +} + @media screen and (max-width: 580px) { main { padding-left: .1em !important;