feat(api,media,auth): Add video upload support and improve media handling
- Add video upload support with separate size limits (100MB for videos, 10MB for images) - Support MP4, WebM, and MOV video formats alongside existing image formats - Add video styling to post cards and compose component with proper object-fit - Improve storage URL configuration with fallback error handling for missing endpoints - Auto-enable NSFW settings when importing accounts from NSFW nodes - Add age verification requirement for importing accounts on NSFW nodes - Allow empty string for avatar and header URLs in profile update validation - Update login page to display node name in browser title - Enhance media upload validation with type-specific error messages
This commit is contained in:
@@ -511,11 +511,31 @@ export function PostCard({ post, onLike, onRepost, onComment, onDelete, onHide,
|
||||
|
||||
{post.media && post.media.length > 0 && (
|
||||
<div className="post-media-grid">
|
||||
{post.media.map((item) => (
|
||||
<div className="post-media-item" key={item.id}>
|
||||
<img src={item.url} alt={item.altText || 'Post media'} loading="lazy" />
|
||||
</div>
|
||||
))}
|
||||
{post.media.map((item) => {
|
||||
const isVideo = item.mimeType?.startsWith('video/');
|
||||
return (
|
||||
<div className="post-media-item" key={item.id}>
|
||||
{isVideo ? (
|
||||
<video
|
||||
src={item.url}
|
||||
autoPlay
|
||||
muted
|
||||
loop
|
||||
playsInline
|
||||
preload="metadata"
|
||||
onClick={(e) => {
|
||||
e.stopPropagation();
|
||||
const video = e.currentTarget;
|
||||
video.muted = !video.muted;
|
||||
}}
|
||||
title="Click to toggle sound"
|
||||
/>
|
||||
) : (
|
||||
<img src={item.url} alt={item.altText || 'Post media'} loading="lazy" />
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
})}
|
||||
</div>
|
||||
)}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user