Skip to content

Commit

Permalink
fix fullscreen
Browse files Browse the repository at this point in the history
  • Loading branch information
jackrifkin committed Jun 17, 2024
1 parent 68a1512 commit e47686d
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions pages/Components/VideoWithToolbar/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ const VideoWithToolbar = ({ src, loops = true, hasToolbar = true }) => {

const toggleFullscreen = () => {
const videoElement = videoRef.current;
videoElement.playsInline = !videoElement.playsInline;
videoElement.playsInline = false;
if (!document.fullscreenElement) {
videoElement.requestFullscreen();
} else {
Expand All @@ -41,6 +41,8 @@ const VideoWithToolbar = ({ src, loops = true, hasToolbar = true }) => {

const handleFullScreenChange = () => {
if (!document.fullscreenElement) {
setIsFullscreen(false)
videoRef.current.playsInline = true;
calculateVideoDimensions();
}
};
Expand Down Expand Up @@ -95,7 +97,7 @@ const VideoWithToolbar = ({ src, loops = true, hasToolbar = true }) => {
controls={false}
autoPlay
loop={loops}
playsInline={!isFullscreen}
playsInline
disableRemotePlayback
muted={!hasToolbar}
onClick={togglePlay}
Expand Down

0 comments on commit e47686d

Please sign in to comment.