From ecc13f5d6697c03177acc7c44ae8ec7d27d847cf Mon Sep 17 00:00:00 2001 From: "sungjin.choi" Date: Fri, 4 Dec 2026 10:08:43 +0900 Subject: [PATCH] =?UTF-8?q?feat=20:=20=EC=9E=90=EB=A3=8C=EC=8B=A4=20?= =?UTF-8?q?=EC=98=81=EC=83=81=20=EC=86=8D=EB=8F=84=20=EB=B2=84=ED=8A=BC=20?= =?UTF-8?q?0.5x=C2=B71x=C2=B72x=C2=B73x=20=EC=88=9C=ED=99=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Opus 5.5 --- src/features/bbs/components/MediaDetail.tsx | 18 +++++++++++------- src/features/bbs/components/bbs.module.css | 2 +- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/src/features/bbs/components/MediaDetail.tsx b/src/features/bbs/components/MediaDetail.tsx index ebe12da..118eea8 100644 --- a/src/features/bbs/components/MediaDetail.tsx +++ b/src/features/bbs/components/MediaDetail.tsx @@ -30,19 +30,23 @@ const seekOnDoubleTap = (e: TouchEvent) => { v.currentTime = Math.max(0, v.currentTime + (touch.clientX - rect.left < rect.width / 2 ? -5 : 5)); }; -/** 영상 + 오른쪽 위 2배속 버튼 (누를 때마다 1x ↔ 2x). 전체화면에서는 버튼이 안 보임 → 브라우저 ⋮ 메뉴 사용 */ +/** 재생 속도 버튼이 누를 때마다 도는 순서 */ +const SPEEDS = [1, 2, 3, 0.5]; + +/** 영상 + 오른쪽 위 속도 버튼 (1x → 2x → 3x → 0.5x → 1x). 전체화면에서는 버튼이 안 보임 → 브라우저 ⋮ 메뉴 사용 */ const Video = ({ src, autoPlay }: { src: string; autoPlay: boolean }) => { const ref = useRef(null); - const [fast, setFast] = useState(false); - const toggle = () => { - if (ref.current) ref.current.playbackRate = fast ? 1 : 2; - setFast(!fast); + const [speed, setSpeed] = useState(1); + const next = () => { + const s = SPEEDS[(SPEEDS.indexOf(speed) + 1) % SPEEDS.length]; + if (ref.current) ref.current.playbackRate = s; + setSpeed(s); }; return (
); diff --git a/src/features/bbs/components/bbs.module.css b/src/features/bbs/components/bbs.module.css index 588ede6..cbd2548 100644 --- a/src/features/bbs/components/bbs.module.css +++ b/src/features/bbs/components/bbs.module.css @@ -113,7 +113,7 @@ .videoBox { position: relative; width: fit-content; max-width: 100%; margin: 0.6em 0; } .videoBox video { margin: 0; } .speed { position: absolute; top: 8px; right: 8px; padding: 0 6px; font: inherit; color: var(--bbs-hi); background: rgb(0 0 0 / 0.6); border: 1px solid var(--bbs-hi); cursor: pointer; } -.speed[aria-pressed="true"] { color: var(--bbs-highlight); border-color: var(--bbs-highlight); } +.speed[data-changed="true"] { color: var(--bbs-highlight); border-color: var(--bbs-highlight); } /* 자료실 받기 목록 */ .files { list-style: none; margin: 0; padding: 0; overflow-wrap: anywhere; } .files a { text-decoration: none; }