diff --git a/TODO.md b/TODO.md index fa08cda..69594a0 100644 --- a/TODO.md +++ b/TODO.md @@ -60,7 +60,7 @@ | [ ] | 토스 미니앱 최신 버전 재등록 — 웹이 바뀌면 자동 반영 안 됨 | 10/21 회의 | | | [ ] | 유튜브 숏폼 자동화 진행 방안 협의 (김성경, 10/22) | 10/21 회의 | | | [ ] | 오늘 화면 쇼츠 줄 — YouTube Data API 키(`YOUTUBE_API_KEY`) 발급해 운영 .env 에 넣기. 없으면 `youtube_shorts`(영상 ID 3개 고정)만 나와 새 쇼츠가 자동으로 안 붙음 (https://console.cloud.google.com/apis/library/youtube.googleapis.com) | 채널 RSS가 404라 키 없이 채널 목록을 못 받음 | `backend/config/settings.py`, `backend/services/shorts_service.py` | -| [ ] | **[결정 필요]** 쇼츠 줄 문구 '날씨각 쇼츠' 검토 | 화면 문구 규칙 | `frontend/src/b/Shorts.tsx` | +| [ ] | **[결정 필요]** 쇼츠 문구 검토: '날씨각 쇼츠', '소리 켜기'/'소리 끄기' | 화면 문구 규칙 | `frontend/src/b/Shorts.tsx` | | [ ] | 쇼츠 자동재생 아이폰 사파리 실기기 확인 — 소리 꺼도 자동재생을 막는다는 보고 있음 | 헤드리스 크롬에서만 확인 | `frontend/src/b/Shorts.tsx` | | [ ] | 인스타 운영 관리자 페이지(자동 게시 전 승인 메일) + 초기 이야기형 피드(각 100개·빨래각·소맥각·점수 산정법) | 10/21 회의 | | | [ ] | 레이어 공유 아이디어 — 사용자 사진 위에 날씨각 정보를 얹어 공유(캐시워크식), 앱 기능으로 | 10/21 회의 (황 본부장 의견, 대표 방향) | | diff --git a/frontend/src/b/Shorts.tsx b/frontend/src/b/Shorts.tsx index 52b47bc..d116d03 100644 --- a/frontend/src/b/Shorts.tsx +++ b/frontend/src/b/Shorts.tsx @@ -16,19 +16,23 @@ const FIT = { width: 'min(100vw, calc((100dvh - env(safe-area-inset-top, 0px) - const YT_ORIGIN = 'https://www.youtube-nocookie.com' -function embed(id: string, controls: boolean, autoplay = true) { +function embed(id: string) { const q = new URLSearchParams({ - autoplay: autoplay ? '1' : '0', mute: '1', playsinline: '1', loop: '1', playlist: id, controls: controls ? '1' : '0', rel: '0', modestbranding: '1', + autoplay: '1', mute: '1', playsinline: '1', loop: '1', playlist: id, controls: '0', rel: '0', modestbranding: '1', enablejsapi: '1', origin: window.location.origin, }) return `${YT_ORIGIN}/embed/${id}?${q}` } -/** 이미 띄운 플레이어에 재생·일시정지 (IFrame API 메시지) */ -function command(frame: HTMLIFrameElement | null | undefined, func: 'playVideo' | 'pauseVideo') { - frame?.contentWindow?.postMessage(JSON.stringify({ event: 'command', func, args: [] }), YT_ORIGIN) +type Func = 'playVideo' | 'pauseVideo' | 'seekTo' | 'mute' | 'unMute' + +/** 이미 띄운 플레이어에 명령 (IFrame API 메시지) */ +function command(frame: HTMLIFrameElement | null | undefined, func: Func, args: unknown[] = []) { + frame?.contentWindow?.postMessage(JSON.stringify({ event: 'command', func, args }), YT_ORIGIN) } +const PLAYING = 1 + /** 화면에 보이는 동안만 true */ function useVisible(threshold = 0.5) { const [el, ref] = useState(null) @@ -82,7 +86,7 @@ function ShortCard({ s, playing, onOpen }: { s: ShortItem; playing: boolean; onO {playing && (