如何在ReactPlayer中禁用键盘F上的全屏?

问题描述 投票:0回答:1

问题是,如果我单击播放视频,并在相邻组件中写入内容,然后不小心按了键盘上的 F 键,则另一个组件中的视频将进入全屏模式。我该如何解决这个问题?

// ...
<ReactPlayer
     {...attrs}
     ref={playerRef}
     className={styles.video}
     playing={playerState.playing}
     volume={playerState.volume}
     onEnded={handleOnEnded}
     onProgress={handlePlayerProgress}
     config={getVideoConfig(autoPlay)}
/>
// ...
export const getVideoConfig = (autoPlay?: boolean): Config => {
  return {
    file: {
      attributes: {
        controls: false,
        autoPlay,
        controlsList: "nofullscreen",
      },
    },
  };
};

我尝试设置controls={false}、vimeoConfig={{ iframeParams: { fullscreen: 0 } }} 以及我在互联网上找到的类似内容,但没有帮助。我仍然输入文本,当我单击 f 时,相邻组件中的视频会进入全屏模式,但我不需要这个。我只想在单击按钮时进入全屏模式

<ButtonWithTooltip
            className={styles.fullScreenBtn}
            Svg={
              screenfull.isFullscreen
                ? videoControlItems.FullScreenButtonIcon
                : videoControlItems.DefaultedScreenButtonIcon
            }
            title={
              screenfull.isFullscreen
                ? videoControlItems.FullScreenButtonTitle
                : videoControlItems.DefaultedScreenButtonTitle
            }
            onClick={handleFullScreen}
/>
reactjs fullscreen react-player
1个回答
0
投票

我解决了问题,与我描述的无关。所以不要在这个问题上浪费时间了,我会删除它,但我找不到删除按钮((

© www.soinside.com 2019 - 2024. All rights reserved.