From 21bfa2a3fff1c9bc3a283021830985bd392a9cdf Mon Sep 17 00:00:00 2001 From: Mina Choi Date: Mon, 26 Oct 2026 16:24:45 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20=ED=86=A0=EC=8A=A4=ED=8C=90=20=EC=87=BC?= =?UTF-8?q?=EC=B8=A0=EB=8A=94=20=EC=9C=A0=ED=8A=9C=EB=B8=8C=20=EA=B8=B0?= =?UTF-8?q?=EB=B3=B8=20=ED=94=8C=EB=A0=88=EC=9D=B4=EC=96=B4=EB=A1=9C=20?= =?UTF-8?q?=E2=80=94=20=ED=86=A0=EC=8A=A4=20=EC=9B=B9=EB=B7=B0=EC=97=94=20?= =?UTF-8?q?=EC=9E=AC=EC=83=9D=20=EC=83=81=ED=83=9C=EA=B0=80=20=EC=95=88=20?= =?UTF-8?q?=EC=99=80=EC=84=9C=20=EC=9E=90=EB=8F=99=EC=9E=AC=EC=83=9D=C2=B7?= =?UTF-8?q?=EC=88=A8=EA=B8=B0=EA=B8=B0=20=EB=8C=80=EC=8B=A0=20=EC=9E=AC?= =?UTF-8?q?=EC=83=9D=20=EB=B2=84=ED=8A=BC=EC=9D=84=20=EC=B2=98=EC=9D=8C?= =?UTF-8?q?=EB=B6=80=ED=84=B0=20=EB=B3=B4=EC=9D=B4=EA=B3=A0,=20=EC=B9=B4?= =?UTF-8?q?=EB=93=9C=EB=8A=94=20=ED=91=9C=EC=A7=80=EC=99=80=20=EC=9E=AC?= =?UTF-8?q?=EC=83=9D=20=EC=95=84=EC=9D=B4=EC=BD=98,=20=EC=87=BC=EC=B8=A0?= =?UTF-8?q?=20=ED=8E=98=EC=9D=B4=EC=A7=80=EC=97=90=20=EC=9D=B4=EC=A0=84?= =?UTF-8?q?=C2=B7=EB=8B=A4=EC=9D=8C=20=EB=B2=84=ED=8A=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/b/Shorts.tsx | 62 ++++++++++++++++++++++++++------------- 1 file changed, 42 insertions(+), 20 deletions(-) diff --git a/frontend/src/b/Shorts.tsx b/frontend/src/b/Shorts.tsx index fb7b0d8..ce435e5 100644 --- a/frontend/src/b/Shorts.tsx +++ b/frontend/src/b/Shorts.tsx @@ -3,6 +3,7 @@ import { type CSSProperties, type PointerEvent as ReactPointerEvent, useEffect, import { Link, useNavigate, useParams } from 'react-router' import { listShortsOptions } from '@nalssigak/shared/api/client/@tanstack/react-query.gen' import type { ShortItem } from '@nalssigak/shared/api/client' +import { IS_TOSS } from '../lib/platform' import { cx } from '../lib/utils' import { Rail, Skel, SkelRail, TAP44 } from './ui' @@ -30,9 +31,12 @@ function useTabBarHeight() { const YT_ORIGIN = 'https://www.youtube-nocookie.com' +// 토스 웹뷰에서는 플레이어가 보내는 재생 상태가 오지 않아, 숨기기·자동재생 없이 유튜브 기본 플레이어(재생 버튼 포함)를 그대로 쓴다 +const PLAIN = IS_TOSS + function embed(id: string) { const q = new URLSearchParams({ - autoplay: '1', mute: '1', playsinline: '1', loop: '1', playlist: id, controls: '0', rel: '0', modestbranding: '1', + autoplay: PLAIN ? '0' : '1', mute: PLAIN ? '0' : '1', playsinline: '1', loop: '1', playlist: id, controls: PLAIN ? '1' : '0', rel: '0', modestbranding: '1', enablejsapi: '1', origin: window.location.origin, }) return `${YT_ORIGIN}/embed/${id}?${q}` @@ -104,7 +108,7 @@ export function ShortsRail() {
{items.map((s, i) => ( - + ))}
@@ -314,6 +318,11 @@ function ShortsViewer({ items, start, onClose, onAt }: { items: ShortItem[]; sta box.scrollTo({ top: target * h, behavior: 'smooth' }) } + const go = (step: number) => { + const box = list.current + if (box) box.scrollTo({ top: (at + step) * box.clientHeight, behavior: 'smooth' }) + } + const toggleSound = () => { const on = !sound soundRef.current = on @@ -342,16 +351,27 @@ function ShortsViewer({ items, start, onClose, onAt }: { items: ShortItem[]; sta - + {PLAIN ? ( +
+ + +
+ ) : ( + + )}
{items.map((s, i) => (
- {Math.abs(i - at) <= 1 && ( + {(PLAIN ? i === at : Math.abs(i - at) <= 1) && (