diff --git a/client/.babelrc b/client/.babelrc new file mode 100644 index 0000000..6e867f9 --- /dev/null +++ b/client/.babelrc @@ -0,0 +1,4 @@ +{ + "presets": [ "@babel/env", "@babel/preset-react" ], + "plugins": [ "@babel/plugin-proposal-class-properties" ] +} diff --git a/client/src/App.js b/client/src/App.js index 4de268a..b1425f5 100644 --- a/client/src/App.js +++ b/client/src/App.js @@ -1,13 +1,10 @@ import './App.css'; +import { PlayerList } from './PlayerList'; function App() { return (
-
-

- Edit src/App.js and save to reload. -

-
+
); } diff --git a/client/src/MediaControl.css b/client/src/MediaControl.css new file mode 100644 index 0000000..8ee364a --- /dev/null +++ b/client/src/MediaControl.css @@ -0,0 +1,92 @@ +.MediaControlSpacer { + display: flex; + width: 5rem; + min-width: 5rem; + height: 3.75rem; + min-height: 3.75rem; + background-color: #444; + border-radius: 0.25rem; +} + +.MediaControlSpacer.Medium { + width: 11.5em; + height: 8.625em; + min-width: 11.5em; + min-height: 8.625em; +} + + +.MediaControl { + display: flex; + position: fixed; + flex-direction: row; + justify-content: flex-end; + align-items: center; + width: 5rem; + height: 3.75rem; + min-width: 5rem; + min-height: 3.75rem; + z-index: 50000; +} + +.MediaControl .Video { + position: relative; + width: 100%; + height: 100%; + background-color: #444; + border-radius: 0.25rem; + border: 1px solid black; +} + +.MediaControl.Medium { + width: 11.5em; + height: 8.625em; + min-width: 11.5em; + min-height: 8.625em; +} + +.MediaControl > div { + display: flex; + position: absolute; + top: 0; + left: 0; + display: flex; + flex-direction: column; + align-items: center; + margin-right: 0.25rem; +} + +.MediaControl .Controls { + display: flex; + position: absolute; + left: 0.5em; + bottom: 0.5em; + justify-content: flex-end; + z-index: 1; +} + +.MediaControl.Small .Controls { + left: 0; + bottom: unset; + justify-content: center; +} + +.MediaControl .Controls > div { + display: flex; + border-radius: 0.25em; + cursor: pointer; + padding: 0.25em; +} + +.MediaControl .Controls > div:hover { + background-color: #d0d0d0; +} + +.moveable-control-box { + border: none; + --moveable-color: unset !important; +} + +.moveable-control-box .moveable-direction { + border: none !important; +} \ No newline at end of file diff --git a/client/src/MediaControl.js b/client/src/MediaControl.js new file mode 100644 index 0000000..b2fd10a --- /dev/null +++ b/client/src/MediaControl.js @@ -0,0 +1,711 @@ +import React, { useState, useEffect, useRef, useCallback, + useContext } from "react"; +import Moveable from "react-moveable"; + +import "./MediaControl.css"; + +import VolumeOff from '@mui/icons-material/VolumeOff'; +import VolumeUp from '@mui/icons-material/VolumeUp'; +import MicOff from '@mui/icons-material/MicOff'; +import Mic from '@mui/icons-material/Mic'; +import VideocamOff from '@mui/icons-material/VideocamOff'; +import Videocam from '@mui/icons-material/Videocam'; + +import { GlobalContext } from "./GlobalContext.js"; +const debug = true; + +/* Proxy object so we can pass in srcObject to