diff --git a/materialious/package-lock.json b/materialious/package-lock.json index cd85171f..13edca5a 100644 --- a/materialious/package-lock.json +++ b/materialious/package-lock.json @@ -1,12 +1,12 @@ { "name": "materialious", - "version": "1.0.11", + "version": "1.1.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "materialious", - "version": "1.0.11", + "version": "1.1.0", "dependencies": { "@capacitor-community/electron": "^5.0.1", "@capacitor/android": "^6.0.0", @@ -19,6 +19,7 @@ "human-number": "^2.0.4", "iso-3166": "^4.3.0", "material-dynamic-colors": "^1.1.0", + "media-captions": "^1.0.3", "media-icons": "^0.10.0", "mousetrap": "^1.6.5", "peerjs": "^1.5.3", diff --git a/materialious/package.json b/materialious/package.json index 5f3c4c62..c69a6523 100644 --- a/materialious/package.json +++ b/materialious/package.json @@ -48,6 +48,7 @@ "human-number": "^2.0.4", "iso-3166": "^4.3.0", "material-dynamic-colors": "^1.1.0", + "media-captions": "^1.0.3", "media-icons": "^0.10.0", "mousetrap": "^1.6.5", "peerjs": "^1.5.3", @@ -57,4 +58,4 @@ "svelte-persisted-store": "^0.9.2", "vidstack": "^1.11.21" } -} \ No newline at end of file +} diff --git a/materialious/src/lib/Player.svelte b/materialious/src/lib/Player.svelte index b658d3fc..1140990a 100644 --- a/materialious/src/lib/Player.svelte +++ b/materialious/src/lib/Player.svelte @@ -53,12 +53,6 @@ page.subscribe((pageUpdate) => loadTimeFromUrl(pageUpdate)); - export function seekTo(time: number) { - if (typeof player !== 'undefined') { - player.currentTime = time; - } - } - const proxyVideos = get(playerProxyVideosStore); onMount(async () => { diff --git a/materialious/src/lib/Thumbnail.svelte b/materialious/src/lib/Thumbnail.svelte index 5d0f0e74..123ebffa 100644 --- a/materialious/src/lib/Thumbnail.svelte +++ b/materialious/src/lib/Thumbnail.svelte @@ -332,7 +332,6 @@ .thumbnail { width: 100%; overflow: hidden; - max-height: 160px; } .thumbnail img { diff --git a/materialious/src/lib/Transcript.svelte b/materialious/src/lib/Transcript.svelte new file mode 100644 index 00000000..a0357137 --- /dev/null +++ b/materialious/src/lib/Transcript.svelte @@ -0,0 +1,139 @@ + + +
+
+
{$_('transcript')}
+
+ + + arrow_drop_down +
+
+ search +
+
+
+
+ + {#if isLoading} + + {:else if transcript} + {#if transcript.cues.length > 0} + {#if transcriptCues.length > 0} + {#each transcriptCues as cue} +
(player.currentTime = cue.startTime)} + class:secondary-container={currentTime >= cue.startTime && currentTime <= cue.endTime} + > +

{videoLength(cue.startTime)}

+

{cue.text}

+
+ {/each} + {:else} + + {/if} + {:else} + + {/if} + {/if} +
+ + diff --git a/materialious/src/lib/i18n/locales/en.json b/materialious/src/lib/i18n/locales/en.json index db578795..6b77904a 100644 --- a/materialious/src/lib/i18n/locales/en.json +++ b/materialious/src/lib/i18n/locales/en.json @@ -13,6 +13,11 @@ "skipping": "Skipping", "replies": "replies", "region": "Region", + "noResult": "No results", + "language": "Language", + "transcript": "Transcript", + "noCaptionData": "Captions don't have any data.", + "selectLang": "Select language", "letterCase": "Letter case for titles", "hideReplies": "Hide replies", "hideVideo": "Hide video", diff --git a/materialious/src/lib/misc.ts b/materialious/src/lib/misc.ts index c14e7f2d..eccf6e69 100644 --- a/materialious/src/lib/misc.ts +++ b/materialious/src/lib/misc.ts @@ -75,7 +75,7 @@ export function cleanNumber(number: number): string { export function videoLength(lengthSeconds: number): string { const hours = Math.floor(lengthSeconds / 3600); let minutes: number | string = Math.floor((lengthSeconds % 3600) / 60); - let seconds: number | string = lengthSeconds % 60; + let seconds: number | string = Math.round(lengthSeconds % 60); if (minutes < 10) { minutes = `0${minutes}`; diff --git a/materialious/src/routes/(app)/subscriptions/manage/+page.svelte b/materialious/src/routes/(app)/subscriptions/manage/+page.svelte index 58ad1d37..c46eb8d4 100644 --- a/materialious/src/routes/(app)/subscriptions/manage/+page.svelte +++ b/materialious/src/routes/(app)/subscriptions/manage/+page.svelte @@ -36,7 +36,7 @@
-
+
search void; let player: MediaPlayerElement; + let showTranscript = false; + playlistSettingsStore.subscribe((playlistSetting) => { if (!data.playlistId) return; if (data.playlistId in playlistSetting) { @@ -398,19 +400,13 @@
-
+
{#key data.video.videoId}
- +
{/key}
@@ -484,6 +480,15 @@ width_wide
{$_('player.theatreMode')}
+
{#if !theatreMode} -
+
+ {#if player && showTranscript} + + {/if} {#if !playlist} {#if data.video.recommendedVideos} {#each data.video.recommendedVideos as recommendedVideo} @@ -700,10 +708,6 @@ --plyr-color-main: var(--primary); } - .grid { - padding: 1em 10em; - } - .timestamps { margin-left: 0; margin-bottom: 0.4em;