Skip to content

Commit 1259682

Browse files
dylanjeffersclaude
andauthored
Fix video embed sizing in fan club post cards (#14226)
## Summary - Fix video embed not filling its 16:9 container in fan club post cards on mobile - The embedded HTML inside the `WebView` set `iframe { height: 100% }` but neither `<html>` nor `<body>` had an explicit height, so the iframe collapsed and left a visible gap inside the card - Add `html, body { width: 100%; height: 100% }` (plus `display: block` and `border: 0` on the iframe) so the iframe actually fills the WebView - Apply the same fix to the shared `VideoEmbed` component, which has identical embed HTML ## Test plan - [ ] Open a fan club detail screen (mobile) and view a post containing a YouTube video — the player should fill the rounded 16:9 card with no whitespace below it - [ ] Verify a Vimeo URL renders the same way - [ ] Verify the locked-post placeholder (lock icon over a 331:170 box) is unchanged - [ ] Verify any other usages of `VideoEmbed` still render correctly https://claude.ai/code/session_01MWtULVCQ8fcSSUnBr7gwfR --- _Generated by [Claude Code](https://claude.ai/code/session_01MWtULVCQ8fcSSUnBr7gwfR)_ --------- Co-authored-by: Claude <noreply@anthropic.com>
1 parent 8c2b99d commit 1259682

3 files changed

Lines changed: 7 additions & 2 deletions

File tree

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@audius/mobile': patch
3+
---
4+
5+
Fix video embed sizing in fan club post cards. The WebView's embedded HTML set `iframe { height: 100% }` but neither `<html>` nor `<body>` had an explicit height, so the iframe collapsed and left a visible gap inside the 16:9 container. Giving `html, body` an explicit `100%` height lets the iframe fill the card as intended.

packages/mobile/src/components/video-embed/VideoEmbed.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ export const VideoEmbed = ({ url }: VideoEmbedProps) => {
3535
>
3636
<WebView
3737
source={{
38-
html: `<!DOCTYPE html><html><head><meta name="viewport" content="width=device-width,initial-scale=1"><style>*{margin:0;padding:0}iframe{width:100%;height:100%;border:none}</style></head><body><iframe src="${embedUrl}" allow="accelerometer;autoplay;clipboard-write;encrypted-media;gyroscope;picture-in-picture" allowfullscreen></iframe></body></html>`,
38+
html: `<!DOCTYPE html><html><head><meta name="viewport" content="width=device-width,initial-scale=1"><style>*{margin:0;padding:0;box-sizing:border-box}html,body{width:100%;height:100%;overflow:hidden;background:transparent}iframe{width:100%;height:100%;border:0;display:block}</style></head><body><iframe src="${embedUrl}" allow="accelerometer;autoplay;clipboard-write;encrypted-media;gyroscope;picture-in-picture" allowfullscreen></iframe></body></html>`,
3939
baseUrl: 'https://audius.co'
4040
}}
4141
style={{ flex: 1, backgroundColor: 'transparent' }}

packages/mobile/src/screens/coin-details-screen/components/TextPostCard.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ export const TextPostCard = ({ commentId, mint }: TextPostCardProps) => {
172172
>
173173
<WebView
174174
source={{
175-
html: `<!DOCTYPE html><html><head><meta name="viewport" content="width=device-width,initial-scale=1"><style>*{margin:0;padding:0}iframe{width:100%;height:100%;border:none}</style></head><body><iframe src="${videoEmbedUrl}" allow="accelerometer;autoplay;clipboard-write;encrypted-media;gyroscope;picture-in-picture" allowfullscreen></iframe></body></html>`,
175+
html: `<!DOCTYPE html><html><head><meta name="viewport" content="width=device-width,initial-scale=1"><style>*{margin:0;padding:0;box-sizing:border-box}html,body{width:100%;height:100%;overflow:hidden;background:transparent}iframe{width:100%;height:100%;border:0;display:block}</style></head><body><iframe src="${videoEmbedUrl}" allow="accelerometer;autoplay;clipboard-write;encrypted-media;gyroscope;picture-in-picture" allowfullscreen></iframe></body></html>`,
176176
baseUrl: 'https://audius.co'
177177
}}
178178
style={{ flex: 1 }}

0 commit comments

Comments
 (0)