From de11d2a297b49dcf27cad90188094be8db92ff51 Mon Sep 17 00:00:00 2001 From: sebastjanartic <45803536-sebastjanartic@users.noreply.replit.com> Date: Wed, 3 Sep 2025 17:34:59 +0000 Subject: [PATCH] Add feature to automatically play the next video when one finishes Implement autoplay functionality for videos. When a video finishes, it will automatically advance to the next video in the sequence after a set delay, with a toggle for enabling/disabling the feature. Replit-Commit-Author: Agent Replit-Commit-Session-Id: 2cd2c0bc-434c-4bc9-ad3f-b99d3897a0d1 Replit-Commit-Checkpoint-Type: full_checkpoint Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/8cc42625-c1f5-4e43-99bd-77f2c4dedee2/2cd2c0bc-434c-4bc9-ad3f-b99d3897a0d1/gjpMN2A --- client/src/pages/VideoPage.tsx | 104 +++++++++++++++++++++++++++++++-- 1 file changed, 98 insertions(+), 6 deletions(-) diff --git a/client/src/pages/VideoPage.tsx b/client/src/pages/VideoPage.tsx index 33badbb..481b1cd 100644 --- a/client/src/pages/VideoPage.tsx +++ b/client/src/pages/VideoPage.tsx @@ -31,7 +31,7 @@ const formatDate = (date: Date | string): string => { }); }; import { Button } from "@/components/ui/button"; -import { Share2, X, Edit3, Menu, Search, ChevronLeft, ChevronRight } from "lucide-react"; +import { Share2, X, Edit3, Menu, Search, ChevronLeft, ChevronRight, Play, Pause } from "lucide-react"; import { Input } from "@/components/ui/input"; import { Link } from "wouter"; import { apiRequest } from "@/lib/queryClient"; @@ -61,6 +61,8 @@ export default function VideoPage() { const [searchQuery, setSearchQuery] = useState(""); const [viewMode, setViewMode] = useState<"grid" | "list">("grid"); const [isMobileMenuOpen, setIsMobileMenuOpen] = useState(false); + const [autoplayEnabled, setAutoplayEnabled] = useState(true); + const [autoplayTimer, setAutoplayTimer] = useState(null); // Fetch current video const { data: currentVideo, isLoading: videoLoading, error: videoError } = useQuery