Update video player to allow seamless transitions between videos
Replace direct window location changes with programmatic navigation for smoother video playback transitions. Replit-Commit-Author: Agent Replit-Commit-Session-Id: 344ec1e0-1186-4058-bbff-2e9619a7b1e0 Replit-Commit-Checkpoint-Type: full_checkpoint Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/8cc42625-c1f5-4e43-99bd-77f2c4dedee2/344ec1e0-1186-4058-bbff-2e9619a7b1e0/FgaI1Sc
This commit is contained in:
parent
dbf70f9e2f
commit
5456496e27
@ -1,6 +1,6 @@
|
|||||||
import { useState, useEffect } from "react";
|
import { useState, useEffect } from "react";
|
||||||
import { useQuery } from "@tanstack/react-query";
|
import { useQuery } from "@tanstack/react-query";
|
||||||
import { useRoute } from "wouter";
|
import { useRoute, useLocation } from "wouter";
|
||||||
import { type Video } from "@shared/schema";
|
import { type Video } from "@shared/schema";
|
||||||
|
|
||||||
import go4LogoPath from "@assets/go4_1756394900352.png";
|
import go4LogoPath from "@assets/go4_1756394900352.png";
|
||||||
@ -52,6 +52,7 @@ interface VideosResponse {
|
|||||||
|
|
||||||
export default function VideoPage() {
|
export default function VideoPage() {
|
||||||
const [, params] = useRoute("/video/:id");
|
const [, params] = useRoute("/video/:id");
|
||||||
|
const [, setLocation] = useLocation();
|
||||||
const videoId = params?.id;
|
const videoId = params?.id;
|
||||||
const [showShareMenu, setShowShareMenu] = useState(false);
|
const [showShareMenu, setShowShareMenu] = useState(false);
|
||||||
const [touchStart, setTouchStart] = useState(0);
|
const [touchStart, setTouchStart] = useState(0);
|
||||||
@ -96,7 +97,7 @@ export default function VideoPage() {
|
|||||||
|
|
||||||
const newVideo = allVideos[newIndex];
|
const newVideo = allVideos[newIndex];
|
||||||
if (newVideo) {
|
if (newVideo) {
|
||||||
window.location.href = `/video/${newVideo.id}`;
|
setLocation(`/video/${newVideo.id}`);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user