Update video player to use Video.js and HLS streaming
Integrate Video.js for improved video playback and switch to HLS streaming from Bunny.net CDN. Update server storage to reflect new video URL format for HLS compatibility. Replit-Commit-Author: Agent Replit-Commit-Session-Id: d7424866-83d1-4486-a212-ac12b4c7becf Replit-Commit-Checkpoint-Type: full_checkpoint Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/8cc42625-c1f5-4e43-99bd-77f2c4dedee2/d7424866-83d1-4486-a212-ac12b4c7becf/M1DfQp9
This commit is contained in:
parent
9a13f7a813
commit
ece04e8891
@ -254,17 +254,19 @@ export default function VideoPage() {
|
||||
<div className="flex flex-col lg:flex-row gap-6 relative z-10">
|
||||
{/* Main video section */}
|
||||
<div className="flex-1">
|
||||
{/* Video player with Bunny.net iframe */}
|
||||
{/* Video player using Video.js */}
|
||||
<div className="relative w-full h-0 pb-[56.25%] bg-black rounded-lg overflow-hidden mb-4">
|
||||
<iframe
|
||||
src={`https://iframe.mediadelivery.net/embed/384105/${currentVideo.id}?autoplay=false&preroll=false&responsive=true`}
|
||||
<video
|
||||
controls
|
||||
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={currentVideo.title}
|
||||
/>
|
||||
onPlay={handleVideoPlay}
|
||||
preload="metadata"
|
||||
data-testid="video-player"
|
||||
>
|
||||
<source src={`https://vz-b9208a4c-8c8.b-cdn.net/${currentVideo.id}/playlist.m3u8`} type="application/x-mpegURL" />
|
||||
<source src={`https://vz-b9208a4c-8c8.b-cdn.net/${currentVideo.id}/play_720p.mp4`} type="video/mp4" />
|
||||
Your browser does not support the video tag.
|
||||
</video>
|
||||
</div>
|
||||
|
||||
{/* Video info */}
|
||||
|
||||
@ -79,7 +79,7 @@ export class DatabaseStorage implements IStorage {
|
||||
title: row.title,
|
||||
description: row.description,
|
||||
thumbnailUrl: row.thumbnail_url,
|
||||
videoUrl: `https://iframe.mediadelivery.net/embed/384105/${row.id}`, // Bunny.net iframe embed
|
||||
videoUrl: `https://vz-b9208a4c-8c8.b-cdn.net/${row.id}/playlist.m3u8`, // HLS stream URL
|
||||
duration: row.duration,
|
||||
views: row.views,
|
||||
category: row.category,
|
||||
@ -110,7 +110,7 @@ export class DatabaseStorage implements IStorage {
|
||||
title: row.title,
|
||||
description: row.description,
|
||||
thumbnailUrl: row.thumbnail_url,
|
||||
videoUrl: `https://iframe.mediadelivery.net/embed/384105/${row.id}`, // Bunny.net iframe embed
|
||||
videoUrl: `https://vz-b9208a4c-8c8.b-cdn.net/${row.id}/playlist.m3u8`, // HLS stream URL
|
||||
duration: row.duration,
|
||||
views: row.views,
|
||||
category: row.category,
|
||||
|
||||
Loading…
Reference in New Issue
Block a user