php 从 Youtube 电影中隐藏框架、进度条和按钮

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/15718894/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-25 09:49:39  来源:igfitidea点击:

Hide frame, progress bar and buttons from Youtube film

phpjqueryhtmlyoutube

提问by Steeven

At a page I am showing a Youtube film in a lightbox.

在一个页面上,我在灯箱中展示 Youtube 电影。

I then want to show only the raw video film - no controls, play/pause buttons, fullscreen option, progress bar etc. Right now it looks like this:

然后我只想显示原始视频电影 - 没有控件、播放/暂停按钮、全屏选项、进度条等。现在它看起来像这样:

Youtube example

优酷示例

and I simply need to remove the top and bottom flash bars with icons. I know it slides away while the films is running, but I wish to always have them hidden.

我只需要删除带有图标的顶部和底部闪光条。我知道在电影播放时它会滑开,但我希望始终将它们隐藏起来。

Is this possible to hide from the film?

这有可能从电影中隐藏吗?

Update

更新

From the answer from @Sven below I added controls=0&showinfo=0&rel=0to the URL in the iframeand got the following:

从下面@Sven 的回答中,我添加controls=0&showinfo=0&rel=0到 中的 URLiframe并得到以下内容:

Youtube example 2

优酷示例 2

This works fine for the purpose. It seems though that a Youtube logo is visible in the lower right corner instead when this other stuff is removed. This logo is only shown at hover.

这可以很好地达到目的。似乎在删除其他内容后,右下角会显示 Youtube 徽标。此徽标仅在悬停时显示。

Any ideas to hide this last bit?

有什么想法可以隐藏最后一点吗?

回答by dersvenhesse

Depending on how you are inserting the video, there are several configuration options. https://developers.google.com/youtube/player_parameters

根据您插入视频的方式,有多种配置选项。 https://developers.google.com/youtube/player_parameters

If you insert the link directly as an iframe most of the options work as GETparameters. In your case add controls=0&showinfo=0to the video url.

如果您将链接直接作为 iframe 插入,则大多数选项都将作为GET参数使用。在您的情况下,添加controls=0&showinfo=0到视频网址。