如何从 React 中 videojs 的标题级联中删除标题设置选项?

问题描述

实际上我已经使用 addRemoteTextTrack 在 vi​​deojs 上添加自定义级联。这工作正常。但是当我点击字幕设置选项时。标题,即被复制。我需要一个解决这个问题的方法。这可能是我从视频中隐藏了字幕设置选项,或者在进行了一些更改之后不会发生重复。

为了添加标题,我在 videojs 上添加了这段代码。

player.addRemoteTextTrack({ mode: 'showing',kind: "captions",label: "English",language: "en" },false);

enter image description here

解决方法

隐藏它的“最简单”方法是将 textTrackSettings 选项设置为 false,然后向页面添加一些 css:

var player = videojs(videoEl,{
  // make the text track settings dialog not initialize
  textTrackSettings: false
});

然后在您的 css 文件中:

/* hide the captions settings item from the captions menu */
.vjs-texttrack-settings {
  display: none;
}

相关问答

错误1:Request method ‘DELETE‘ not supported 错误还原:...
错误1:启动docker镜像时报错:Error response from daemon:...
错误1:private field ‘xxx‘ is never assigned 按Alt...
报错如下,通过源不能下载,最后警告pip需升级版本 Requirem...