Add video thumbnails and playback in Assets
Video assets now show their first frame as a thumbnail in the grid instead of a generic Film icon, and the detail modal includes a video player with controls. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -3,6 +3,7 @@ import { Plus, Upload, Search, FolderOpen, ChevronRight, Grid3X3, X } from 'luci
|
||||
import { api } from '../utils/api'
|
||||
import AssetCard from '../components/AssetCard'
|
||||
import Modal from '../components/Modal'
|
||||
import CommentsSection from '../components/CommentsSection'
|
||||
|
||||
export default function Assets() {
|
||||
const [assets, setAssets] = useState([])
|
||||
@@ -284,6 +285,11 @@ export default function Assets() {
|
||||
<img src={selectedAsset.url} alt={selectedAsset.name} className="w-full max-h-[400px] object-contain" />
|
||||
</div>
|
||||
)}
|
||||
{selectedAsset.type === 'video' && selectedAsset.url && (
|
||||
<div className="rounded-lg overflow-hidden bg-surface-tertiary">
|
||||
<video src={selectedAsset.url} controls preload="metadata" className="w-full max-h-[400px]" />
|
||||
</div>
|
||||
)}
|
||||
<div className="grid grid-cols-2 gap-4 text-sm">
|
||||
<div>
|
||||
<p className="text-text-tertiary">Type</p>
|
||||
@@ -318,6 +324,7 @@ export default function Assets() {
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
<CommentsSection entityType="asset" entityId={selectedAsset.id || selectedAsset._id} />
|
||||
<div className="flex items-center gap-3 pt-4 border-t border-border">
|
||||
<button
|
||||
onClick={() => handleDeleteAsset(selectedAsset)}
|
||||
|
||||
Reference in New Issue
Block a user