-
Notifications
You must be signed in to change notification settings - Fork 590
feat: support video headers in editorial #12853
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Update ArticleHero component to match web implementation for video heroes: - Position text overlay absolutely on top of video using LinearGradient - Add gradient background (transparent to rgba(0,0,0,0.6)) for readability - Style text in white with subtle shadows (15px blur, 0.25 opacity) - Maintain existing behavior for image heroes (text below image) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
Updates article hero video to match web implementation where video height is calculated as max(50vh - navHeight, 360px) instead of using aspect ratio. This ensures consistent behavior with the web FULLSCREEN layout, where the video fills a height-constrained container with object-fit: cover. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
- Added react-native-linear-gradient mock to setupJest.tsx so it's available globally for all tests - Updated ArticleHero tests to explicitly set media: null in test data to ensure image rendering path is tested instead of video path - Removed local LinearGradient mock from ArticleHero tests since it's now global 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
- Changed video preload from "metadata" to "auto" for faster loading - Enabled WebView caching (cacheEnabled: true, cacheMode: "LOAD_DEFAULT") - Added mixedContentMode="always" for better Android network performance - Added Android-specific optimizations (javaScriptEnabled, domStorageEnabled, allowFileAccess) - Added testID to ArticleHeroVideo component for testing - Added test for video rendering - Fixed WebView mock to export both default and named WebView export 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
| return <View ref={ref} {...props} /> | ||
| }), | ||
| default: MockWebView, | ||
| WebView: MockWebView, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
missing named export mock was causing test failures
| </body> | ||
| </html> | ||
| `, | ||
| [videoUrl, backgroundColor] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
using embedded html and webviews built in video playback capabilities, customization is limited and performance specifically on Android is not great (at least on my old test device), but is what we are currently using for embedded videos, if we find it is not up to the task we should explore video libraries like react-native-video
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
noice!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! clean
This PR resolves DIAM-129
Description
Adds basic video header support for native editorial articles.
Embeds the video in a webview, the same approach we use for embedded videos elsewhere in articles.
Draft until tested for performance and design sign off.
android-video-header-low.mov
video-header-low.mov
PR Checklist
To the reviewers 👀
Changelog updates
Changelog updates
Cross-platform user-facing changes
iOS user-facing changes
Android user-facing changes
Dev changes
Need help with something? Have a look at our docs, or get in touch with us.