fix: resolve 4 media embed bugs from testing
1. Video aspect ratio: remove container border/overflow-hidden, use preload="metadata" so browser knows dimensions before play 2. YouTube Error 153: remove sandbox attr (too restrictive), add full allow permissions (encrypted-media, accelerometer, gyroscope, etc.) 3. Google Images not displaying: detect image Content-Type from HTTP response in metadataFetcher, override classifier to create image embed for URLs that serve image/* content 4. Audio seeking broken: add HTTP Range request support in uploads route (Accept-Ranges, Content-Range, 206 Partial Content)
This commit is contained in:
@@ -44,10 +44,10 @@ export function AttachmentRenderer({ attachment }: AttachmentRendererProps) {
|
||||
|
||||
if (mimetype.startsWith('video/')) {
|
||||
return (
|
||||
<div className="mt-1 max-w-[520px] rounded-lg overflow-hidden border border-white/[0.06]">
|
||||
<div className="mt-1 max-w-[520px]">
|
||||
<video
|
||||
controls
|
||||
preload="none"
|
||||
preload="metadata"
|
||||
poster={thumbUrl ?? undefined}
|
||||
className="max-w-full max-h-[400px] rounded-lg"
|
||||
>
|
||||
|
||||
@@ -36,8 +36,8 @@ export function VideoEmbed({ embed }: VideoEmbedProps) {
|
||||
className="absolute inset-0 w-full h-full"
|
||||
src={`${embed.embedUrl}?autoplay=1`}
|
||||
title={embed.title ?? 'Video'}
|
||||
allow="autoplay; fullscreen; picture-in-picture"
|
||||
sandbox="allow-scripts allow-same-origin allow-popups"
|
||||
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share"
|
||||
allowFullScreen
|
||||
referrerPolicy="no-referrer"
|
||||
/>
|
||||
) : (
|
||||
|
||||
Reference in New Issue
Block a user