OStack程序员社区-中国程序员成长平台

标题: ios - 如何隐藏播放/暂停按钮? [打印本页]

作者: 菜鸟教程小白    时间: 2022-12-13 17:01
标题: ios - 如何隐藏播放/暂停按钮?

正如问题所暗示的,我想从“Youtube”播放器中隐藏播放/暂停按钮。
我在用 https://github.com/youtube/youtube-ios-player-helper

并像这样设置 playerVars 参数:

 let playerVars = [
        "controls" : 0,
        "playsinline" : 1,
        "autohide" : 0,
        "showinfo" : 0,
        "modestbranding" : 0
    ]

enter image description here



Best Answer-推荐答案


我发现有用的三个参数是:

showinfo=0
controls=0
autohide=1

showinfo=0 确保视频不会在视频帧的顶部显示标题。

controls=0 用播放按钮、音量等隐藏底栏。

autohide=1 隐藏控件,直到您将鼠标悬停在它们上方,这可能是最有用的。

All the official docs are here.

但您可以使用嵌入自定义 CSS 来隐藏或调整播放按钮的位置。

button.ytp-large-play-button.ytp-button {
    display: none;
}

关于ios - 如何隐藏播放/暂停按钮?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37984683/






欢迎光临 OStack程序员社区-中国程序员成长平台 (http://ostack.cn/) Powered by Discuz! X3.4