feat: add note content support for direct video URLs

- Add noteContent prop to VideoView component for displaying note text
- Update VideoView to prioritize note content over metadata when available
- Detect direct video URLs from Nostr notes (nostr.build, nostr.video domains)
- Pass bookmark information through URL selection in bookmark components
- Show placeholder message for direct videos from Nostr notes
- Maintains backward compatibility with existing video metadata extraction
This commit is contained in:
Gigi
2025-10-25 00:30:07 +02:00
parent 4e4d719d94
commit c69e50d3bb
5 changed files with 15 additions and 5 deletions

View File

@@ -381,6 +381,12 @@ const ThreePaneLayout: React.FC<ThreePaneLayoutProps> = (props) => {
const isExternalVideo = !isNostrArticle && !!props.selectedUrl && ['youtube', 'video'].includes(classifyUrl(props.selectedUrl).type)
if (isExternalVideo) {
// Check if this is a direct video URL from a Nostr note
// For URLs like /r/https%3A%2F%2Fv.nostr.build%2FWFO5YkruM9GFJjeg.mp4
const isDirectVideoFromNote = props.selectedUrl?.includes('nostr.build') ||
props.selectedUrl?.includes('nostr.video') ||
props.selectedUrl?.includes('v.nostr.build')
return (
<VideoView
videoUrl={props.selectedUrl!}
@@ -391,6 +397,7 @@ const ThreePaneLayout: React.FC<ThreePaneLayoutProps> = (props) => {
settings={props.settings}
relayPool={props.relayPool}
activeAccount={props.activeAccount}
noteContent={isDirectVideoFromNote ? "This video was shared from a Nostr note. The original note content would be displayed here if available." : undefined}
onOpenHighlights={() => {
if (props.isHighlightsCollapsed) {
props.onToggleHighlightsPanel()