Only include 16x if browser is not Firefox

This commit is contained in:
Carlos Gustavo Sarmiento 2022-05-02 16:16:50 -05:00 committed by Blake Blackshear
parent f512df44c1
commit 90bff605fa

View File

@ -8,7 +8,7 @@ import 'videojs-seek-buttons/dist/videojs-seek-buttons.css';
const defaultOptions = {
controls: true,
playbackRates: [0.5, 1, 2, 4, 8, 16],
playbackRates: [0.5, 1, 2, 4, 8],
fluid: true,
};
const defaultSeekOptions = {
@ -18,7 +18,11 @@ const defaultSeekOptions = {
export default function VideoPlayer({ children, options, seekOptions = {}, onReady = () => {}, onDispose = () => {} }) {
const playerRef = useRef();
if (!videojs.browser.IS_FIREFOX) {
defaultOptions.playbackRates.push(16);
}
useEffect(() => {
const player = videojs(playerRef.current, { ...defaultOptions, ...options }, () => {
onReady(player);