html 更改 YouTube 视频的颜色
html change color on youtube video
我需要一些帮助。我在许多不同的网站上看到他们已经更改了 youtube 视频菜单的颜色。
这个
不知道怎么改颜色
我的代码。
<iframe width="760" height="428" src="https://www.youtube.com/embed/92HOgzQvtOw" frameborder="0" allowfullscreen></iframe>
如果你知道如何改变颜色,请发表评论我一直在到处搜索,但我没有找到答案。希望我能在这里得到一个:)
谢谢
尝试将 ?theme=light
添加到 YouTube URL。
编辑:由于 YouTube 改变了播放器的工作方式,此答案已弃用。我会尽可能更新这个答案。
您可以在嵌入 Youtube 视频时指定 color
来更改它,如他们的文档中所述 here。
color (supported players: AS3, HTML5) This parameter specifies the
color that will be used in the player's video progress bar to
highlight the amount of the video that the viewer has already seen.
Valid parameter values are red and white, and, by default, the player
will use the color red in the video progress bar.
不幸的是,AS3 和 JavaScript 现在似乎已被弃用,因此您将不得不使用 Youtube Iframe 嵌入 API。他们有我 link 编辑过的文档,我相信您可以通过简单地使嵌入 link 具有颜色参数来进行设置,即
https://www.youtube.com/embed/M7lc1UVf-VE?颜色=白色
<iframe width="560" height="315" src="https://www.youtube.com/embed/M7lc1UVf-VE?color=white" frameborder="0" allowfullscreen></iframe>
如果您想要自定义颜色...我认为唯一的方法是创建自定义进度条(以及所有视频控件,因为两者绑定在一起。这有点广泛。我觉得他们是故意的他们这样做是为了让玩家可以忠于原始品牌。但是您可以使用 API 做一些事情,因为您可以访问 player.getVideoLoadedFraction()
和 player.getCurrentTime()
播放状态
player.getVideoLoadedFraction():Float Returns a number between 0 and 1
that specifies the percentage of the video that the player shows as
buffered. This method returns a more reliable number than the
now-deprecated getVideoBytesLoaded and getVideoBytesTotal methods.
因此,如果您确实需要,可以通过在 JavaScript 中输入值来自定义您自己的进度条。
我用谷歌搜索了一下,找到了这个网站:https://www.reembed.com
这里还有更多帮助。看来您可能必须使用 YouTube API 才能获得您想要的内容:http://tutorialzine.com/2010/07/youtube-api-custom-player-jquery-css/
也许这能帮到你?
我需要一些帮助。我在许多不同的网站上看到他们已经更改了 youtube 视频菜单的颜色。
这个
不知道怎么改颜色
我的代码。
<iframe width="760" height="428" src="https://www.youtube.com/embed/92HOgzQvtOw" frameborder="0" allowfullscreen></iframe>
如果你知道如何改变颜色,请发表评论我一直在到处搜索,但我没有找到答案。希望我能在这里得到一个:)
谢谢
尝试将 ?theme=light
添加到 YouTube URL。
编辑:由于 YouTube 改变了播放器的工作方式,此答案已弃用。我会尽可能更新这个答案。
您可以在嵌入 Youtube 视频时指定 color
来更改它,如他们的文档中所述 here。
color (supported players: AS3, HTML5) This parameter specifies the color that will be used in the player's video progress bar to highlight the amount of the video that the viewer has already seen. Valid parameter values are red and white, and, by default, the player will use the color red in the video progress bar.
不幸的是,AS3 和 JavaScript 现在似乎已被弃用,因此您将不得不使用 Youtube Iframe 嵌入 API。他们有我 link 编辑过的文档,我相信您可以通过简单地使嵌入 link 具有颜色参数来进行设置,即
https://www.youtube.com/embed/M7lc1UVf-VE?颜色=白色
<iframe width="560" height="315" src="https://www.youtube.com/embed/M7lc1UVf-VE?color=white" frameborder="0" allowfullscreen></iframe>
如果您想要自定义颜色...我认为唯一的方法是创建自定义进度条(以及所有视频控件,因为两者绑定在一起。这有点广泛。我觉得他们是故意的他们这样做是为了让玩家可以忠于原始品牌。但是您可以使用 API 做一些事情,因为您可以访问 player.getVideoLoadedFraction()
和 player.getCurrentTime()
播放状态
player.getVideoLoadedFraction():Float Returns a number between 0 and 1 that specifies the percentage of the video that the player shows as buffered. This method returns a more reliable number than the now-deprecated getVideoBytesLoaded and getVideoBytesTotal methods.
因此,如果您确实需要,可以通过在 JavaScript 中输入值来自定义您自己的进度条。
我用谷歌搜索了一下,找到了这个网站:https://www.reembed.com 这里还有更多帮助。看来您可能必须使用 YouTube API 才能获得您想要的内容:http://tutorialzine.com/2010/07/youtube-api-custom-player-jquery-css/
也许这能帮到你?