Skip to content

armgit / macro

Public Imported from GitHub
0

Macro is a unified workspace for teams: email, chat, docs, tasks, agents, calls, and CRM — @-linked together with shared AI memory.

fix[channels]: video preview on safari (#2474)

Peter Chinmanf1f622557342
diff --git a/js/app/packages/channel/Media/MediaVideo.tsx b/js/app/packages/channel/Media/MediaVideo.tsx
index 339bb9903d..a80bb188dd 100644
--- a/js/app/packages/channel/Media/MediaVideo.tsx
+++ b/js/app/packages/channel/Media/MediaVideo.tsx
@@ -27,6 +27,11 @@ function Preview(props: {
width={props.width}
height={props.height}
onClick={() => props.onOpen?.()}
+ onLoadedMetadata={(e) => {
+ // iOS Safari doesn't paint the first frame with preload="metadata".
+ // Seeking to a tiny positive time forces it to decode and display the frame.
+ e.currentTarget.currentTime = 0.001;
+ }}
/>
);
}
diff --git a/js/app/packages/core/component/VideoPreview.tsx b/js/app/packages/core/component/VideoPreview.tsx
index a05f32a28d..004dfd4fc4 100644
--- a/js/app/packages/core/component/VideoPreview.tsx
+++ b/js/app/packages/core/component/VideoPreview.tsx
@@ -38,6 +38,11 @@ export function VideoPreview(props: VideoPreviewProps) {
src={staticFileIdEndpoint(props.id)}
width={props.width ?? undefined}
height={props.height ?? undefined}
+ onLoadedMetadata={(e) => {
+ // iOS Safari doesn't paint the first frame with preload="metadata".
+ // Seeking to a tiny positive time forces it to decode and display the frame.
+ e.currentTarget.currentTime = 0.001;
+ }}
/>
</div>
);