1
0
Fork 0
mirror of https://github.com/sussy-code/smov.git synced 2024-12-23 15:07:43 +01:00
smov/src/components/video/controls/SourceControl.tsx
Jelle van Snik a64841507f port providers, media watch page + make search work again
Co-authored-by: James Hawkins <jhawki2005@gmail.com>
2023-01-14 00:12:56 +01:00

22 lines
528 B
TypeScript

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;
}