Bluesky app fork with some witchin' additions 💫

Properly fill container for YT Shorts videos (#3238)

account for jest

account for jest

yt iframe fill container

authored by hailey.at and committed by

GitHub 88ab83bd 79175e2a

+16 -9
+5 -7
bskyweb/static/iframe/youtube.html
··· 5 5 } 6 6 .container { 7 7 position: relative; 8 - width: 100%; 9 - height: 0; 10 - padding-bottom: 56.25%; 8 + overflow: hidden; 9 + width: 100vw; 10 + height: 100vh; 11 11 } 12 12 .video { 13 13 position: absolute; 14 - top: 0; 15 - left: 0; 16 - width: 100%; 17 - height: 100%; 14 + width: 100vw; 15 + height: 100vh; 18 16 } 19 17 </style> 20 18 <div class="container"><div class="video" id="player"></div></div>
+11 -2
src/lib/strings/embed-player.ts
··· 2 2 import {isWeb} from 'platform/detection' 3 3 const {height: SCREEN_HEIGHT} = Dimensions.get('window') 4 4 5 + const IFRAME_HOST = isWeb 6 + ? // @ts-ignore only for web 7 + window.location.host === 'localhost:8100' 8 + ? 'http://localhost:8100' 9 + : 'https://bsky.app' 10 + : __DEV__ && !process.env.JEST_WORKER_ID 11 + ? 'http://localhost:8100' 12 + : 'https://bsky.app' 13 + 5 14 export const embedPlayerSources = [ 6 15 'youtube', 7 16 'youtubeShorts', ··· 74 83 return { 75 84 type: 'youtube_video', 76 85 source: 'youtube', 77 - playerUri: `https://bsky.app/iframe/youtube.html?videoId=${videoId}&start=${seek}`, 86 + playerUri: `${IFRAME_HOST}/iframe/youtube.html?videoId=${videoId}&start=${seek}`, 78 87 } 79 88 } 80 89 } ··· 93 102 type: page === 'shorts' ? 'youtube_short' : 'youtube_video', 94 103 source: page === 'shorts' ? 'youtubeShorts' : 'youtube', 95 104 hideDetails: page === 'shorts' ? true : undefined, 96 - playerUri: `https://bsky.app/iframe/youtube.html?videoId=${videoId}&start=${seek}`, 105 + playerUri: `${IFRAME_HOST}/iframe/youtube.html?videoId=${videoId}&start=${seek}`, 97 106 } 98 107 } 99 108 }