A small web app for watching movies and shows easily
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

17 lines
629 B

import { resetForSource } from "@/video/state/init";
import { updateMediaPlaying } from "@/video/state/logic/mediaplaying";
import { updateMisc } from "@/video/state/logic/misc";
import { updateProgress } from "@/video/state/logic/progress";
import { VideoPlayerState } from "@/video/state/types";
export function resetStateForSource(descriptor: string, s: VideoPlayerState) {
const state = s;
if (state.hlsInstance) {
state.hlsInstance.destroy();
state.hlsInstance = null;
}
resetForSource(state);
updateMediaPlaying(descriptor, state);
updateProgress(descriptor, state);
updateMisc(descriptor, state);
}