Undo changes to video player

This commit is contained in:
Nick Mowen 2022-10-31 07:45:01 -06:00
parent 3ea8e7f58f
commit f7c7f4b4e7

View File

@ -6,7 +6,7 @@ import 'videojs-seek-buttons';
import 'video.js/dist/video-js.css'; import 'video.js/dist/video-js.css';
import 'videojs-seek-buttons/dist/videojs-seek-buttons.css'; import 'videojs-seek-buttons/dist/videojs-seek-buttons.css';
export default function VideoPlayer({ children, options, audio=true, live=false, seekOptions = {}, onReady = () => {}, onDispose = () => {} }) { export default function VideoPlayer({ children, options, seekOptions = {}, onReady = () => {}, onDispose = () => {} }) {
const playerRef = useRef(); const playerRef = useRef();
useEffect(() => { useEffect(() => {
@ -25,7 +25,7 @@ export default function VideoPlayer({ children, options, audio=true, live=false,
defaultOptions.playbackRates.push(16); defaultOptions.playbackRates.push(16);
} }
const player = videojs(playerRef.current, { ...defaultOptions, ...options, controlBar: { volumePanel: audio, playToggle: !live, progressControl: !live, remainingTimeDisplay: !live, playbackRateMenuButton: !live } }, () => { const player = videojs(playerRef.current, { ...defaultOptions, ...options }, () => {
onReady(player); onReady(player);
}); });
player.seekButtons({ player.seekButtons({