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



HTML:

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

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;
}

上面的一些CSS在iOS 15中删除了播放/暂停按钮,但在iOS 16中不再有效——按钮会显示,视频流启动一段时间后暂停按钮就会消失。

谢谢!

有问题的元素是否有控件="false";在上面?

我在我的视频中也经历了同样的行为,但在省略了控制后就解决了;false";。我很感激你的例子没有具体说明这一点,但这是我能够复制你帖子中指定的行为的唯一方法。

最新更新