Fix direct streaming

This commit is contained in:
WithoutPants 2022-10-10 18:54:55 +11:00 committed by GitHub
parent 043b67e076
commit 90fdc6b322
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 2 deletions

View File

@ -311,10 +311,11 @@ export const ScenePlayer: React.FC<IScenePlayerProps> = ({
function handleOffset(player: VideoJsPlayer) {
if (!scene || !file) return;
const currentSrc = player.currentSrc();
const currentSrc = new URL(player.currentSrc());
const isDirect =
currentSrc.endsWith("/stream") || currentSrc.endsWith("/stream.m3u8");
currentSrc.pathname.endsWith("/stream") ||
currentSrc.pathname.endsWith("/stream.m3u8");
const curTime = player.currentTime();
if (!isDirect) {