Skip to content

🎥 Make videos programmatically with React

added exit fullscreen icon

Shankhadeep Deybb22bbd2800c
diff --git a/packages/player/src/PlayerControls.tsx b/packages/player/src/PlayerControls.tsx
index d2c49b5b5b..2eef092d65 100644
--- a/packages/player/src/PlayerControls.tsx
+++ b/packages/player/src/PlayerControls.tsx
@@ -1,7 +1,7 @@
import React, {MouseEventHandler, useMemo} from 'react';
import {Internals} from 'remotion';
import {formatTime} from './format-time';
-import {FullscreenIcon, PauseIcon, PlayIcon} from './icons';
+import {FullscreenExitIcon, FullscreenIcon, PauseIcon, PlayIcon} from './icons';
import {PlayerSeekBar} from './PlayerSeekBar';
import {usePlayer} from './use-player';
import {browserSupportsFullscreen} from './utils/browser-supports-fullscreen';
@@ -127,7 +127,7 @@ export const Controls: React.FC<{
: onFullscreenButtonClick
}
>
- <FullscreenIcon />
+ {isFullscreen ? <FullscreenExitIcon /> : <FullscreenIcon />}
</button>
</div>
) : null}
diff --git a/packages/player/src/icons.tsx b/packages/player/src/icons.tsx
index 94aa8a640d..4bd7810025 100644
--- a/packages/player/src/icons.tsx
+++ b/packages/player/src/icons.tsx
@@ -39,3 +39,20 @@ export const FullscreenIcon: React.FC = () => {
</svg>
);
};
+
+export const FullscreenExitIcon: React.FC = () => {
+ return (
+ <svg
+ xmlns="http://www.w3.org/2000/svg"
+ height={size}
+ width={size}
+ viewBox="0 0 24 24"
+ >
+ <path fill="none" d="M0 0h24v24H0z" />
+ <path
+ d="M5 16h3v3h2v-5H5v2zm3-8H5v2h5V5H8v3zm6 11h2v-3h3v-2h-5v5zm2-11V5h-2v5h5V8h-3z"
+ fill="#fff"
+ />
+ </svg>
+ );
+};