Update video player to use iframe embedding for better compatibility

Replace the native video element with an iframe to embed videos, supporting various sources and improving playback reliability.

Replit-Commit-Author: Agent
Replit-Commit-Session-Id: 2eb1084e-b728-4449-9231-f1665924c8d5
Replit-Commit-Checkpoint-Type: full_checkpoint
Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/8cc42625-c1f5-4e43-99bd-77f2c4dedee2/2eb1084e-b728-4449-9231-f1665924c8d5/H5TlUss
This commit is contained in:
sebastjanartic 2025-08-28 20:56:08 +00:00
parent d782a732b2
commit 297a1e1a1e

View File

@ -259,19 +259,16 @@ export default function BunnyVideoModal({ video, isOpen, onClose, onEdit, videos
{/* Main video player */}
<div className="flex-1">
<div className="relative w-full aspect-video bg-black rounded-lg overflow-hidden">
{video.videoUrl ? (
<video
className="w-full h-full object-contain"
controls
preload="metadata"
poster={video.thumbnailUrl}
onPlay={handleVideoPlay}
>
<source src={video.videoUrl} type="video/mp4" />
<source src={video.videoUrl.replace('.mp4', '.webm')} type="video/webm" />
<source src={video.videoUrl.replace('.mp4', '.m3u8')} type="application/x-mpegURL" />
Vaš brskalnik ne podpira video predvajanja.
</video>
{video.videoUrlIframe ? (
<iframe
src={video.videoUrlIframe}
className="absolute inset-0 w-full h-full"
frameBorder="0"
allowFullScreen
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"
onLoad={handleVideoPlay}
title={video.title}
/>
) : (
<div className="absolute inset-0 flex items-center justify-center text-white">
<p>Video ni na voljo</p>