From bc2b425fb781113beb10dcdd840457f49cc63a12 Mon Sep 17 00:00:00 2001
From: sebastjanartic <45803536-sebastjanartic@users.noreply.replit.com>
Date: Thu, 25 Sep 2025 20:29:16 +0000
Subject: [PATCH] Add live streaming functionality for real-time video
broadcasts
Integrates a new live streaming page with Video.js player, handling autoplay, playback events, volume changes, fullscreen, and error states. Also includes ad integration for the live stream.
Replit-Commit-Author: Agent
Replit-Commit-Session-Id: 45a1dcfc-f8a2-475a-a6b9-96fbb841dc27
Replit-Commit-Checkpoint-Type: intermediate_checkpoint
Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/60d372ff-2c10-46c7-b01b-10c3435136b0/45a1dcfc-f8a2-475a-a6b9-96fbb841dc27/CdguB3F
---
client/src/App.tsx | 2 ++
client/src/pages/LivePage.tsx | 63 ++++++++++++++++++-----------------
2 files changed, 35 insertions(+), 30 deletions(-)
diff --git a/client/src/App.tsx b/client/src/App.tsx
index bb71947..b3754b9 100644
--- a/client/src/App.tsx
+++ b/client/src/App.tsx
@@ -9,6 +9,7 @@ import VideoPage from "@/pages/VideoPage";
import FolxStadlPage from "@/pages/FolxStadlPage";
import GeschichteLiedPage from "@/pages/GeschichteLiedPage";
import GipfelstammtischPage from "@/pages/GipfelstammtischPage";
+import LivePage from "@/pages/LivePage";
import AdminPage from "@/pages/admin";
import PrivacyPolicy from "@/pages/PrivacyPolicy";
import TermsOfService from "@/pages/TermsOfService";
@@ -23,6 +24,7 @@ function Router() {
+
diff --git a/client/src/pages/LivePage.tsx b/client/src/pages/LivePage.tsx
index 54ecd84..0634bf0 100644
--- a/client/src/pages/LivePage.tsx
+++ b/client/src/pages/LivePage.tsx
@@ -111,40 +111,44 @@ export default function LivePage() {
setIsLoading(false);
// Auto-play live stream
- player?.play().catch((error: any) => {
- console.log('Live stream autoplay prevented:', error);
- });
- });
-
- // Event listeners
- player.on('play', () => {
- console.log('π΄ Live stream started');
- setIsPlaying(true);
- });
-
- player.on('pause', () => {
- console.log('βΈοΈ Live stream paused');
- setIsPlaying(false);
- });
-
- player.on('volumechange', () => {
if (player) {
- const vol = player.volume();
- const muted = player.muted();
- setVolume(vol);
- setIsMuted(muted);
- console.log('π Live stream volume change:', { volume: vol, muted });
+ player.play().catch((error: any) => {
+ console.log('Live stream autoplay prevented:', error);
+ });
}
});
- player.on('fullscreenchange', () => {
- setIsFullscreen(!!player?.isFullscreen());
- });
+ // Event listeners
+ if (player) {
+ player.on('play', () => {
+ console.log('π΄ Live stream started');
+ setIsPlaying(true);
+ });
- player.on('error', (e: any) => {
- console.error('π¨ Live stream error:', e);
- setIsLoading(false);
- });
+ player.on('pause', () => {
+ console.log('βΈοΈ Live stream paused');
+ setIsPlaying(false);
+ });
+
+ player.on('volumechange', () => {
+ if (player) {
+ const vol = player.volume();
+ const muted = player.muted();
+ setVolume(vol);
+ setIsMuted(muted);
+ console.log('π Live stream volume change:', { volume: vol, muted });
+ }
+ });
+
+ player.on('fullscreenchange', () => {
+ setIsFullscreen(document.fullscreenElement !== null);
+ });
+
+ player.on('error', (e: any) => {
+ console.error('π¨ Live stream error:', e);
+ setIsLoading(false);
+ });
+ }
playerRef.current = player;
@@ -316,7 +320,6 @@ export default function LivePage() {