feature: theatre mode in the platform
Is your feature request related to a problem? Please describe. For people using only one screen having theatre mode in the platform is really useful and a great ux
Describe the solution you'd like Currently video.js is used which supports theatre mode. So I think it is not that difficult to implement theatre mode.
import React, { useEffect, useRef, FunctionComponent, useState } from 'react'; import videojs from 'video.js'; import 'video.js/dist/video-js.css';
interface VideoPlayerProps {
}
const VideoPlayer: FunctionComponent<VideoPlayerProps> = ({ props }) => {
const videoRef = useRef<HTMLVideoElement>(null);
const [playing, setPlaying] = useState
useEffect(() => { const videoElement = videoRef.current; if (!videoElement) return;
const player = videojs(videoElement);
player.on('play', () => {
setPlaying(true);
});
player.on('pause', () => {
setPlaying(false);
});
// Listen for fullscreenchange event
player.on('fullscreenchange', () => {
setIsFullscreen(player.isFullscreen());
});
return () => {
player.dispose();
};
}, []);
const togglePlayPause = () => { const videoElement = videoRef.current; if (!videoElement) return;
if (videoElement.paused) {
videoElement.play();
} else {
videoElement.pause();
}
};
const toggleFullscreen = () => { const videoElement = videoRef.current; if (!videoElement) return;
if (!isFullscreen) {
videoElement.requestFullscreen();
} else {
document.exitFullscreen();
}
};
return (
export default VideoPlayer; /////////////////// logic is this if i am not wrong? //////////////////