Skip to content

Add responsive video embed styling and improve iframe base URL handling#45

Merged
NateEaton merged 1 commit intomainfrom
claude/fix-video-embed-display-I7P1C
Feb 9, 2026
Merged

Add responsive video embed styling and improve iframe base URL handling#45
NateEaton merged 1 commit intomainfrom
claude/fix-video-embed-display-I7P1C

Conversation

@NateEaton
Copy link
Copy Markdown
Owner

Summary

This PR enhances video content handling by adding responsive video embed styling across all HTML templates and improving how iframe base URLs are extracted for proper content loading.

Key Changes

  • Added responsive video embed CSS to all three HTML templates (dark, light, sepia):

    • New .video-embed class using padding-bottom technique for 16:9 aspect ratio
    • Absolute positioning for iframe and video elements to maintain responsiveness
    • Consistent margins matching other content blocks
  • Improved iframe base URL extraction in BookmarkDetailScreen:

    • New extractEmbedBaseUrl() function that parses iframe src attributes using regex
    • Safely extracts scheme and host from embed HTML for use as WebView base URL
    • Graceful fallback to original bookmark URL if parsing fails
  • Enhanced video embed HTML wrapping in BookmarkDetailViewModel:

    • Automatically wraps iframe embeds in the new .video-embed div container
    • Preserves non-iframe embed content as-is
    • Ensures proper responsive behavior for embedded videos

Implementation Details

  • The extractEmbedBaseUrl() function uses regex to find iframe src attributes and Uri.parse() for safe URL parsing
  • The responsive video technique uses padding-top: 56.25% to maintain 16:9 aspect ratio without knowing video dimensions
  • Changes are applied consistently across all theme variants to maintain visual consistency

https://claude.ai/code/session_01KfcuMiGfVnvJu14WGLK6yR

Wrap iframe embeds in a .video-embed div for reliable 16:9 rendering,
add responsive CSS to all HTML templates, and set the WebView base URL
to the iframe's host so embedded providers can load their resources.

https://claude.ai/code/session_01KfcuMiGfVnvJu14WGLK6yR
@NateEaton NateEaton marked this pull request as ready for review February 9, 2026 06:16
@chatgpt-codex-connector
Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@NateEaton NateEaton merged commit 48716fe into main Feb 9, 2026
3 checks passed
@NateEaton NateEaton mentioned this pull request Feb 9, 2026
@NateEaton NateEaton deleted the claude/fix-video-embed-display-I7P1C branch February 20, 2026 17:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants