如何隐藏react-native-video中的额外控件

发布于 2025-01-19 05:03:48 字数 575 浏览 4 评论 0 原文

我正在使用React-Native-video,并且正在尝试弄清楚如何仅隐藏下图中的两个按钮(标题和条形图)。 我仍然想要清理和时间。传递控件= false隐藏我不想要的一切。

这是我当前的播放器组件设置

<Video
          onPlaybackRateChange={onPlaybackRateChange}
          source={{ uri }}
          resizeMode="contain"
          useNativeDriver={true}
          style={styles.video}
          disableTimer={true}
          controls={true}
        />

”在此处输入图像说明”

I'm using react-native-video and I am trying to figure out how to hide only the two buttons (caption and bar graph thing) in the image below.
I still want the scrubbar and time. Passing controls=false hides everything which I dont want.

This is my current player component setup

<Video
          onPlaybackRateChange={onPlaybackRateChange}
          source={{ uri }}
          resizeMode="contain"
          useNativeDriver={true}
          style={styles.video}
          disableTimer={true}
          controls={true}
        />

enter image description here

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

笑饮青盏花 2025-01-26 05:03:48

我认为你应该使用 controls={true} 属性隐藏控件,并使用其他包进行电影控制,例如 react-native-video-controlsreact-native-video-player文档

I think you should hide controls with controls={true} prop and use other packages for movie control like react-native-video-controls or react-native-video-player as mentioned in documentation

冷心人i 2025-01-26 05:03:48

React Native Video中有一个配置属性可以自定义控件,但似乎不包含字幕。

controlsStyles={{
  hidePosition: false,
  hidePlayPause: false,
  hideForward: false,
  hideRewind: false,
  hideNext: false,
  hidePrevious: false,
  hideFullscreen: false,
  hideSeekBar: false,
  hideDuration: false,
  hideNavigationBarOnFullScreenMode: true,
  hideNotificationBarOnFullScreenMode: true,
  hideSettingButton: true,
  seekIncrementMS: 10000,
  liveLabel: "LIVE"
}}

https://docs.thewidlarzgroup.com/reaeact-native-video/组件/道具#控制

There is a config property in react native video to customize the controls but it doesn't seem to include the captions.

controlsStyles={{
  hidePosition: false,
  hidePlayPause: false,
  hideForward: false,
  hideRewind: false,
  hideNext: false,
  hidePrevious: false,
  hideFullscreen: false,
  hideSeekBar: false,
  hideDuration: false,
  hideNavigationBarOnFullScreenMode: true,
  hideNotificationBarOnFullScreenMode: true,
  hideSettingButton: true,
  seekIncrementMS: 10000,
  liveLabel: "LIVE"
}}

https://docs.thewidlarzgroup.com/react-native-video/component/props#controls

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文