Skip to content

Commit 1f15e25

Browse files
Hide elements that may overlay embedded players. (#1856)
1 parent b4c6493 commit 1f15e25

File tree

1 file changed

+29
-20
lines changed

1 file changed

+29
-20
lines changed

src/components/Video/index.js

+29-20
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,11 @@ import VideoToolbar from './VideoToolbar';
99
import MouseMoveCapture from './VideoMouseMoveCapture';
1010
import Player from '../Player';
1111

12+
// Overlays over the video (even tiny in the corner like ours) violate TOS,
13+
// so we can not show them. Toggling it off with a conditional for now until
14+
// we find a good place for the fullscreen control (if we do).
15+
const OVERLAY_ALLOWED = false;
16+
1217
const {
1318
useCallback,
1419
useEffect,
@@ -110,26 +115,30 @@ function Video(props) {
110115
seek={seek}
111116
/>
112117

113-
{isFullscreen && (
114-
<MouseMoveCapture
115-
active={shouldShowToolbar}
116-
onMouseMove={handleMouseMove}
117-
/>
118-
)}
119-
{isFullscreen && (
120-
<VideoProgressBar
121-
media={media}
122-
seek={seek}
123-
/>
124-
)}
125-
{(!isFullscreen || shouldShowToolbar) && (
126-
<VideoToolbar
127-
isFullscreen={isFullscreen}
128-
onFullscreenEnter={handleRequestFullscreenEnter}
129-
onFullscreenExit={onFullscreenExit}
130-
>
131-
<MediaSourceTools media={media} />
132-
</VideoToolbar>
118+
{OVERLAY_ALLOWED && (
119+
<>
120+
{isFullscreen && (
121+
<MouseMoveCapture
122+
active={shouldShowToolbar}
123+
onMouseMove={handleMouseMove}
124+
/>
125+
)}
126+
{isFullscreen && (
127+
<VideoProgressBar
128+
media={media}
129+
seek={seek}
130+
/>
131+
)}
132+
{(!isFullscreen || shouldShowToolbar) && (
133+
<VideoToolbar
134+
isFullscreen={isFullscreen}
135+
onFullscreenEnter={handleRequestFullscreenEnter}
136+
onFullscreenExit={onFullscreenExit}
137+
>
138+
<MediaSourceTools media={media} />
139+
</VideoToolbar>
140+
)}
141+
</>
133142
)}
134143
</div>
135144
);

0 commit comments

Comments
 (0)