diff --git a/frontend/src/pages/mobile/public/ScheduleDetail.jsx b/frontend/src/pages/mobile/public/ScheduleDetail.jsx index ab508c9..f2cc58d 100644 --- a/frontend/src/pages/mobile/public/ScheduleDetail.jsx +++ b/frontend/src/pages/mobile/public/ScheduleDetail.jsx @@ -144,19 +144,6 @@ const decodeHtmlEntities = (text) => { return textarea.value; }; -// 유튜브 비디오 ID 추출 (YoutubeSection용) -const extractYoutubeVideoId = (url) => { - if (!url) return null; - const shortMatch = url.match(/youtu\.be\/([a-zA-Z0-9_-]{11})/); - if (shortMatch) return shortMatch[1]; - const watchMatch = url.match(/youtube\.com\/watch\?v=([a-zA-Z0-9_-]{11})/); - if (watchMatch) return watchMatch[1]; - const shortsMatch = url.match(/youtube\.com\/shorts\/([a-zA-Z0-9_-]{11})/); - if (shortsMatch) return shortsMatch[1]; - return null; -}; - - // 날짜 포맷팅 const formatFullDate = (dateStr) => { if (!dateStr) return ''; @@ -180,8 +167,8 @@ const extractXUsername = (url) => { // 유튜브 섹션 컴포넌트 function YoutubeSection({ schedule }) { - const videoId = extractYoutubeVideoId(schedule.source?.url); - const isShorts = schedule.source?.url?.includes('/shorts/'); + const videoId = schedule.videoId; + const isShorts = schedule.videoType === 'shorts'; // 전체화면 시 가로 회전 (숏츠 제외) useFullscreenOrientation(isShorts); @@ -229,18 +216,12 @@ function YoutubeSection({ schedule }) {