youtube - 相关的youtube视频,尽管REL = 0

标签 youtube

我创建了一个小的YouTube画廊。单击其中一个缩略图会在主DIV中播放视频。尽管我在youtube iframe源中设置了REL = 0,但相关视频仍在显示。任何想法为什么会这样?
这是发生问题的页面:
https://www.itaysharf.com/%D7%A0%D7%99%D7%95%D7%95%D7%9F-%D7%A8%D7%A9%D7%AA%D7%99%D7%AA/

HTML和JS代码:

$(".video_wrapper li").click(function() {
    $('html, body').animate({
        scrollTop: $("#bigvid").offset().top
    }, 1000);
});

 $(".video_wrapper").on('click',"a", function(event) {
	
 
	 
  event.preventDefault();
  event.stopImmediatePropagation();
  event.stopPropagation();
 
 $(".video_case iframe").prop("src", $(event.currentTarget).attr("href"));
 


});
    <div class="video_case" id="bigvid">
    <iframe width="705" height="445" src="https://www.youtube.com/embed/<?php the_field('main-video'); ?>&#63rel=0" frameborder="0" allowfullscreen allow="autoplay"></iframe>
  <span class="desc">  <?php the_field('video-desc'); ?></span>
</div>

<?php if (get_field('video-id-1')): ?>
<div class="video_wrapper">
    <ul>
        <li class="video_thumbnail"><a href="https://www.youtube.com/embed/<?php the_field('video-id-1'); ?>&#63rel=0&amp;autoplay=1" class="video-1" title=""><span class="video-btn"></span><img src="https://img.youtube.com/vi/<?php the_field('video-id-1'); ?>/mqdefault.jpg" alt="<?php the_field('video-alt-1'); ?>"/></a></li>
        <li class="video_thumbnail"><a href="https://www.youtube.com/embed/<?php the_field('video-id-2'); ?>&#63rel=0&amp;autoplay=1" class="video-2" title=""><span class="video-btn"></span><img src="https://img.youtube.com/vi/<?php the_field('video-id-2'); ?>/mqdefault.jpg" alt="<?php the_field('video-alt-2'); ?>"/></a></li>
        <li class="video_thumbnail"><a href="https://www.youtube.com/embed/<?php the_field('video-id-3'); ?>&#63rel=0&amp;autoplay=1" class="video-3" title=""><span class="video-btn"></span><img src="https://img.youtube.com/vi/<?php the_field('video-id-3'); ?>/mqdefault.jpg" alt="<?php the_field('video-alt-3'); ?>"/></a></li>
    </ul>
</div>
<?php endif; ?>


谢谢你的帮助

最佳答案

https://developers.google.com/youtube/player_parameters#release_notes_08_23_2018

The behavior for the rel parameter is changing on or after September 25, 2018. The effect of the change is that you will not be able to disable related videos. However, you will have the option of specifying that the related videos shown in the player should be from the same channel as the video that was just played.

关于youtube - 相关的youtube视频,尽管REL = 0,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53048764/

相关文章:

jquery - 在带jQuery的youTube和Vimeo源之间切换

facebook - Facebook广告跟踪

javascript - 如何在 javascript 中使用带有 youtube spa 技术的 mutationobserver

javascript - 使用 API v3.0 为特定视频创建 Youtube "like"按钮

javascript - YouTube Iframe API 初始化后,player.getPlayerState 不可用

javascript - Bootstrap 模式与youtube视频在关闭时不会暂停

python - 为什么 youtube 不给我视频链接而只给我他们的资源页面?

youtube - 如何通过YouTube官方PHP SDK将YouTube视频添加到播放列表

actionscript-3 - 我不断从 AS3 中的 youTube API V3 收到 404

css - 如何在笔记本电脑图像中设置嵌入视频