From ff0609458ab50dd627b13b604f7c8c42af9a67b3 Mon Sep 17 00:00:00 2001 From: lonkaars Date: Sat, 24 Jul 2021 15:27:56 +0200 Subject: video source settings beginnings --- components/icons.tsx | 12 ++++++++++- components/videosourcesettings.tsx | 43 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 54 insertions(+), 1 deletion(-) create mode 100644 components/videosourcesettings.tsx (limited to 'components') diff --git a/components/icons.tsx b/components/icons.tsx index 5e06bf8..3240f9e 100644 --- a/components/icons.tsx +++ b/components/icons.tsx @@ -267,7 +267,7 @@ export function BracketsRoundedIcon() { ; } -export function SlashIconRounded() { +export function SlashRoundedIcon() { return ; } + +export function UploadRoundedIcon() { + return + + + + ; +} diff --git a/components/videosourcesettings.tsx b/components/videosourcesettings.tsx new file mode 100644 index 0000000..ae7f75b --- /dev/null +++ b/components/videosourcesettings.tsx @@ -0,0 +1,43 @@ +import { useRef } from 'react'; +import { LocalVideo } from '../project'; + +import Button from '@material-ui/core/Button'; +import Switch from '@material-ui/core/Switch'; + +import { UploadRoundedIcon } from './icons'; + +export function LocalVideoSettings(props: { settings: LocalVideo; }) { + var fileUploadRef = useRef(null); + + return <> + { + var file = event.target.files[0]; + if (!file) return; + var reader = new FileReader(); + reader.addEventListener('load', async ev => { + props.settings.load(ev.target.result as ArrayBuffer); + }); + reader.readAsArrayBuffer(file); + }} + /> +