简体   繁体   English

iOS中隐藏媒体播放控件 16 WKWebView

[英]Hide media playback controls in iOS 16 WKWebView

HTML: HTML:

<video id="video-stream" autoplay playsinline></video>

CSS: CSS:

*::-webkit-media-controls {
  display: none !important;
  -webkit-appearance: none !important;
}
*::-webkit-media-controls-panel {
  display: none !important;
  -webkit-appearance: none !important;
}
*::-webkit-media-controls-play-button {
  display: none !important;
  -webkit-appearance: none !important;
}
*::-webkit-media-controls-start-playback-button {
  display: none !important;
  -webkit-appearance: none !important;
}

Some of the CSS above was removing play/pause buttons in iOS 15, but it no longer works in iOS 16 - the buttons show, and pause button disappears after some time once video stream starts.上面的一些 CSS 在 iOS 15 中删除了播放/暂停按钮,但它在 iOS 16 中不再起作用 - 一旦视频 stream 开始,按钮显示,暂停按钮在一段时间后消失。

Thank you!谢谢!

Is it possible the problematic element has controls="false" on it?有问题的元素上是否有 controls="false" ?

I was experiencing the same behavior on my video but it resolved after omitting controls="false".我在我的视频中遇到了相同的行为,但在省略 controls="false" 后解决了。 I appreciate your example doesn't specify this but that's the only way I've been able to replicate the behavior specified in your post.感谢您的示例没有指定这一点,但这是我能够复制您帖子中指定的行为的唯一方法。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM