📎
@@ -124,7 +125,7 @@ export default function MessageAttachments({ messageId }) {
.att-error { color: var(--color-error); }
.att-spinner { width: 13px; height: 13px; border: 2px solid rgba(127,127,127,.3); border-top-color: var(--color-brand-primary); border-radius: 50%; animation: spin .8s linear infinite; }
.att-image { max-width: 260px; max-height: 320px; border-radius: .5rem; display: block; cursor: pointer; }
- .att-video { max-width: 280px; max-height: 320px; border-radius: .5rem; display: block; background: #000; }
+ .att-video { width: 280px; max-width: 100%; aspect-ratio: 16 / 9; max-height: 320px; border-radius: .5rem; display: block; background: #000; }
.att-audio { width: 240px; }
.att-file { display: flex; align-items: center; gap: .4rem; padding: .5rem .625rem; background: var(--color-bg-tertiary); border: 1px solid var(--color-border-primary); border-radius: .5rem; text-decoration: none; color: var(--color-text-primary); max-width: 260px; }
.att-file:hover { background: var(--color-bg-secondary); }
diff --git a/src/lib/components/media/EnhancedVideoPlayer.jsx b/src/lib/components/media/EnhancedVideoPlayer.jsx
index d2c20e9c..bb56d36f 100644
--- a/src/lib/components/media/EnhancedVideoPlayer.jsx
+++ b/src/lib/components/media/EnhancedVideoPlayer.jsx
@@ -1,22 +1,33 @@
'use client';
import { useRef, useEffect } from 'react';
+import { createPlayer } from '@profullstack/player';
+import '@profullstack/player/player.css';
-export default function EnhancedVideoPlayer({ src, type = 'video/mp4', controls = true, autoPlay = false }) {
- const videoRef = useRef(null);
+/**
+ * Plays a video or audio attachment in the house player (@profullstack/player):
+ * one control bar with auto-hide, full screen including iPhone.
+ *
+ * Attachments are decrypted into blob: URLs, which carry no file extension, so
+ * the caller passes the MIME type and the player is told the kind outright
+ * instead of sniffing the URL.
+ */
+export default function EnhancedVideoPlayer({ src, type = 'video/mp4', audio = false, autoPlay = false, className = '' }) {
+ const rootRef = useRef(null);
useEffect(() => {
- if (videoRef.current && src) {
- videoRef.current.load();
- }
- }, [src]);
+ const root = rootRef.current;
+ if (!root || !src) return undefined;
+ const isAudio = audio || (type || '').toLowerCase().startsWith('audio/');
+ const handle = createPlayer(root, {
+ src,
+ kind: isAudio ? 'audio' : 'mp4',
+ audio: isAudio,
+ ...(type ? { mimeType: type } : {}),
+ autoplay: autoPlay,
+ });
+ return () => handle.destroy();
+ }, [src, type, audio, autoPlay]);
- return (
-
-
-
- );
+ return ;
}