feat: use note content as title for direct video URLs

- Extract first 100 characters of note content as video title
- Truncate with ellipsis if content is longer than 100 characters
- Fallback to YouTube metadata title or original title if no note content
- Improves user experience by showing meaningful titles for direct videos from Nostr notes
This commit is contained in:
Gigi
2025-10-25 00:30:32 +02:00
parent c69e50d3bb
commit 717f094984

View File

@@ -210,8 +210,10 @@ const VideoView: React.FC<VideoViewProps> = ({
}
}
const displayTitle = ytMeta?.title || title
// For direct video URLs from Nostr notes, prioritize note content over metadata
// For direct video URLs from Nostr notes, use note content for title and description
const displayTitle = noteContent ?
(noteContent.length > 100 ? noteContent.substring(0, 100).trim() + '...' : noteContent) :
(ytMeta?.title || title)
const displaySummary = noteContent || ytMeta?.description || summary
const durationText = videoDurationSec !== null ? formatDuration(videoDurationSec) : null