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.
 
 
 
 
 

22 lines
528 B

import { MWStreamType } from "@/backend/helpers/streams";
import { useContext, useEffect } from "react";
import { VideoPlayerDispatchContext } from "../VideoContext";
interface SourceControlProps {
source: string;
type: MWStreamType;
}
export function SourceControl(props: SourceControlProps) {
const dispatch = useContext(VideoPlayerDispatchContext);
useEffect(() => {
dispatch({
type: "SET_SOURCE",
url: props.source,
sourceType: props.type,
});
}, [props, dispatch]);
return null;
}