.net 从嵌入的 YouTube 视频中删除品牌和标题链接

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/16435934/
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-09-03 12:14:18  来源:igfitidea点击:

Remove branding and title link from embeded youtube video

.netyoutubeyoutube-apiyoutube-javascript-apiyoutube.net-api

提问by narayanan.L

Can anyone please suggest a way to remove link back to youtube and branding (watermark or logo) from embedded youtube video.

任何人都可以建议一种方法来从嵌入的 youtube 视频中删除回 youtube 和品牌(水印或徽标)的链接。

The below tag remove branding:

以下标签删除品牌:

<iframe allowfullscreen="" frameborder="0" height="315" src="http://www.youtube.com/embed/8pjJ-Czqpps?modestbranding=1&amp;rel=0" width="420"></iframe>

The below tag remove title link:

下面的标签删除标题链接:

<iframe allowfullscreen="" frameborder="0" height="315" src="http://www.youtube.com/embed  /8pjJ-Czqpps?showinfo=0" width="420"></iframe>

But cant able to make all together happening.

但不能让所有一起发生。

Please help.

请帮忙。

回答by Mekey Salaria

Yes, YouTube says:

是的,YouTube 说:

If you use the Embed-able Player on your website, you may not modify, build upon, or block     
any portion or functionality of the Embed-able Player, including but not limited to links    
back to the YouTube website.

So, don't try to use CSS tricks especially when you are an Adsense publisher.

因此,不要尝试使用 CSS 技巧,尤其是当您是 Adsense 发布商时。

回答by narayanan.L

I have managed to hide the title by providing a div(by applying css position:absolute) above iframe.

我设法通过在iframe上方提供一个div(通过应用 css position:absolute)来隐藏标题。

I have removed the YouTube logo by providing modestbranding=1.

我通过提供适度品牌=1删除了 YouTube 徽标。

<html>
<head>
</head>
<body>
<div style="background-color:black;height:30px;width:420px;position:absolute">
</div>
<div>
<iframe id="div1" allowfullscreen="" frameborder="0" height="315"
        src="http://www.youtube.com/embed/8pjJ-Czqpps?modestbranding=1&rel=0&fs=0"
        width="420">
</iframe>
</div>
</body>
</html>

Thanks..

谢谢..

回答by Sandeep Pattanaik

Here is the best answer for your question.

这是您问题的最佳答案。

<iframe width=”213″ height=”120″ src=”http://www.youtube.com/embed/nhP1d-NjFHQ?rel=0″ frameborder=”0″ allowfullscreen></iframe>

The highlighted section is what we will be adding to. All it takes is adding &showinfo=0 to the ened of the YouTube URL before the closing bracket. Note that “rel=0″ refers to showing related videos once your video has ended, so if it's not there simply put your code snippet after a ‘?' like you see preceding ‘rel=0′ Once you set showinfo to equal zero, you should get a nice, clean YouTube video right on your website. You're embed code will then look like this:

突出显示的部分是我们将要添加的部分。只需在 YouTube URL 的右括号前添加 &showinfo=0 即可。请注意,“rel=0”是指在您的视频结束后显示相关视频,因此如果没有,只需将您的代码片段放在“?”之后。就像你在前面看到的 'rel=0' 一旦你将 showinfo 设置为零,你应该在你的网站上获得一个漂亮、干净的 YouTube 视频。您嵌入的代码将如下所示:

<iframe width=”213″ height=”120″ src=”http://www.youtube.com/embed/nhP1d-NjFHQ?rel=0&showinfo=0″ frameborder=”0″ allowfullscreen></iframe>

The original article you found here.

您在此处找到的原始文章。

回答by Shirley Ashby

youryoutubelink/.../?rel=0&amp;fs=0&amp;showinfo=0"

This removes Logo and Title at the same time. Modestbrandingdoesn't work at the same time as showinfo, it's either one or the other, hence the workaround.

这会同时删除徽标和标题。Modestbranding与 不同时工作showinfo,它是一个或另一个,因此解决方法。

回答by marcnyc

Actually I found the way to remove everything but the initial watermark/play button. If you use the div trick coupled with the the modestbranding=1 and the controls=0, you get a clean youtube video with no titles or links whatsoever.

实际上,我找到了删除除初始水印/播放按钮之外的所有内容的方法。如果您将 div 技巧与适度品牌=1 和控件=0 结合使用,您将获得一个干净的 YouTube 视频,没有任何标题或链接。

This is what I did:

这就是我所做的:

<div style="background-color:black;height:30px;width:420px;position:absolute">
&nbsp;</div>
<div>
<iframe allowfullscreen="" frameborder="0" height="315" id="div1" src="http://www.youtube.com/embed/XXXXXXXXXXXXXXXXXXXXX?modestbranding=1&amp;rel=0&amp;fs=0&amp;controls=0" width="420"></iframe></div>

回答by Ibrahim Ulukaya

I believe you can't get rid of both as it's against the Terms of Serviceanyways.

我相信您无法摆脱两者,因为它无论如何都违反了服务条款

回答by Mikolov

Append &modestbranding=1 to the end of your URL or after another parameter and the link will no longer appear.

将 &modestbranding=1 附加到您的 URL 末尾或另一个参数之后,该链接将不再出现。

source:http://www.warriorforum.com/main-internet-marketing-discussion-forum/779427-youtube-embed-tricks-other-tips.html

来源:http: //www.warriorforum.com/main-internet-marketing-discussion-forum/779427-youtube-embed-tricks-other-tips.html

回答by Grahame

The YouTube iFrame API has a 'Getting Started' code snippetbut fails to mention how you pass the parameters.

YouTube iFrame API 有一个“入门”代码片段,但没有提及您如何传递参数。

API

应用程序接口

You need to pass all your parameters in a 'playerVars' object like a so

您需要像这样在“playerVars”对象中传递所有参数

function onYouTubeIframeAPIReady() {
        player = new YT.Player('player', {
          playerVars: {
                theme: 'dark',
                wmode: 'opaque',
                autohide: '1',
                autoplay: '0',
                controls: '1',
                modestbranding: '0',
                disablekb: '0',
                showinfo: '0',
                rel: '0'
          },
          videoId: '123123123123',
          events: {
            'onReady': onPlayerReady,
            'onStateChange': onPlayerStateChange
          }
        });

iFrame Embed

iFrame 嵌入

The alternative is using the iframe embed and pass your arguments in the query string like a so

另一种方法是使用 iframe 嵌入并像这样在查询字符串中传递您的参数

https://www.youtube.com/embed/123123123?wmode=opaque&rel=0&autoplay=0&loop=1&showinfo=0&modestbranding=1&disablekb=1&controls=1 

回答by Bipon360

Demo: http://bdtune24.com/gtv-live/
You can use this Plugin if your site build in wordpress.[https://wordpress.org/plugins/videojs-html5-video-player-for-wordpress/]

演示:http: //bdtune24.com/gtv-live/
如果您的网站构建在 wordpress 中,您可以使用此插件。[ https://wordpress.org/plugins/videojs-html5-video-player-for-wordpress/]

After install That....you can embed any youtube or vimeo video....
Like this: [videojs youtube="https://www.youtube.com/watch?v=0iiCkqA533E"]

安装后......你可以嵌入任何youtube或vimeo视频......
像这样:[videojs youtube="https://www.youtube.com/watch?v=0iiCkqA533E"]

回答by Ram

Try the following code

试试下面的代码

<iframe id="ytplayer" type="text/html" width="640" height="360" src="https://www.youtube.com/embed/8pjJ-Czqpps?modestbranding=1&showinfo=0&iv_load_policy=3&nologo=1" frameborder="0" allowfullscreen></iframe>