From 62040ed88a4b80a4eb375b7d8db609b05e318c22 Mon Sep 17 00:00:00 2001 From: ElementalAlchemist Date: Sun, 17 Nov 2024 23:50:13 -0600 Subject: [PATCH] Add speed and quality settings The quality setting will need some UX improvements later (in particular to show the name of the selected quality level), but it functions as a quality setting. --- thrimbletrimmer/src/common/video.tsx | 63 ++++++++++++++++++++++++++-- 1 file changed, 60 insertions(+), 3 deletions(-) diff --git a/thrimbletrimmer/src/common/video.tsx b/thrimbletrimmer/src/common/video.tsx index 59d05b5..a0c0bb1 100644 --- a/thrimbletrimmer/src/common/video.tsx +++ b/thrimbletrimmer/src/common/video.tsx @@ -3,8 +3,6 @@ import { Component, createEffect, createSignal, - For, - onCleanup, onMount, Setter, Show, @@ -210,13 +208,16 @@ export const VideoPlayer: Component = (props) => { let [playerTime, setPlayerTime] = createSignal(0); let [duration, setDuration] = createSignal(0); + let [playbackSpeed, setPlaybackSpeed] = createSignal(1); + let [qualityName, setQualityName] = createSignal(""); onMount(() => { const player = props.mediaPlayer(); - player.subscribe(({ currentTime, duration }) => { + player.subscribe(({ currentTime, duration, playbackRate }) => { setPlayerTime(currentTime); props.setPlayerTime(currentTime); setDuration(duration); + setPlaybackSpeed(playbackRate); }); player.streamType = "on-demand"; }); @@ -296,6 +297,62 @@ export const VideoPlayer: Component = (props) => {
+ + + + + + + + + Settings + + + +
+
+
Speed
+
{playbackSpeed()}x
+
+
+
+ +
+
+
+ + + +
+
+
+
+
+
+
Quality
+
+
+
+
+ +
+
+
+
+ + + +
+
+
+
+
+
+