mirror of
https://github.com/sussy-code/smov.git
synced 2024-12-22 14:57:40 +01:00
a64841507f
Co-authored-by: James Hawkins <jhawki2005@gmail.com>
22 lines
528 B
TypeScript
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;
|
|
}
|