-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
All controls and hotkeys work when the VideoPlayer is fullscreen Controls are below video instead of inside of it Controls have tooltips showing what they do and their hotkeys Each control is a separate component that is used in both mobile and normal controls Video Progress slider is above controls to save horizontal space Controls will disappear when fullscreen if mouse leaves video player, or after 5 seconds of inactivity Default port in vite.config.ts set to 3000 for simplicity.
- Loading branch information
1 parent
29de8a8
commit 53eaad4
Showing
16 changed files
with
439 additions
and
303 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
109 changes: 0 additions & 109 deletions
109
src/components/common/VideoPlayer/Components/MobileControls.tsx
This file was deleted.
Oops, something went wrong.
66 changes: 66 additions & 0 deletions
66
src/components/common/VideoPlayer/Components/MobileControlsBar.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
import { MoreVert as MoreIcon } from "@mui/icons-material"; | ||
import { Box, IconButton, Menu, MenuItem } from "@mui/material"; | ||
import { useVideoContext } from "./VideoContext.ts"; | ||
import { | ||
FullscreenButton, | ||
PictureInPictureButton, | ||
PlaybackRate, | ||
PlayButton, | ||
ProgressSlider, | ||
ReloadButton, | ||
VideoTime, | ||
VolumeButton, | ||
VolumeSlider, | ||
} from "./VideoControls.tsx"; | ||
|
||
export const MobileControlsBar = () => { | ||
const { handleMenuOpen, handleMenuClose, anchorEl } = useVideoContext(); | ||
|
||
const controlGroupSX = { display: "flex", gap: "5px", alignItems: "center" }; | ||
|
||
return ( | ||
<> | ||
<Box sx={controlGroupSX}> | ||
<PlayButton /> | ||
<ReloadButton /> | ||
<ProgressSlider /> | ||
<VideoTime /> | ||
</Box> | ||
|
||
<Box sx={controlGroupSX}> | ||
<PlaybackRate /> | ||
<FullscreenButton /> | ||
|
||
<IconButton | ||
edge="end" | ||
color="inherit" | ||
aria-label="menu" | ||
onClick={handleMenuOpen} | ||
sx={{ minWidth: "30px", paddingLeft: "0px" }} | ||
> | ||
<MoreIcon /> | ||
</IconButton> | ||
</Box> | ||
<Menu | ||
id="simple-menu" | ||
anchorEl={anchorEl.value} | ||
keepMounted | ||
open={Boolean(anchorEl.value)} | ||
onClose={handleMenuClose} | ||
PaperProps={{ | ||
style: { | ||
width: "250px", | ||
}, | ||
}} | ||
> | ||
<MenuItem> | ||
<VolumeButton /> | ||
<VolumeSlider /> | ||
</MenuItem> | ||
<MenuItem> | ||
<PictureInPictureButton /> | ||
</MenuItem> | ||
</Menu> | ||
</> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.