How to remove more video from youtube embed?

为君一笑 提交于 2020-06-27 08:15:27

问题


Here is my site link https://www.suffolkconferencecenter.com on the landing page we have slider in which we have displayed a youtube video, On the video paused more video thumbnail will appear at the bottom of the slider. Please kindly help us to remove that more video from the screen.

We have already tried rel=0 but its not working for us.

Thanks, HK


回答1:


According to new changes made by YouTube on Sept 2018, suggested videos coudn't be disabled.

About rel parameter:

Note: This parameter is changing on or after September 25, 2018.

Prior to the change, this parameter(rel) indicates whether the player should show related videos when playback of the initial video ends. If the parameter's value is set to 1, which is the default value, then the player does show related videos. If the parameter's value is set to 0, then the player does not show related videos. After the change, you will not be able to disable related videos. Instead, if the rel parameter is set to 0, related videos will come from the same channel as the video that was just played.




回答2:


I have also struggled with this many times. The solution I found is to use an ad-blocker add-on to hide that element from displaying at all. By adding this to your own filter

www.youtube.com##.ytp-scroll-min.ytp-pause-overlay

But be sure not disable the ads to support the video creator




回答3:


This solution might not be the best since it hides the video title along with the youtube controls (may be undesirable) but some people might find it useful.

You can make the video player really tall and then crop the top and bottom to hide the more videos section, which is done with divs, so our embed html may look something like this:

  <body>
    <div id="player-size" style="">
      <div id="cropping-div" style="">
        <div id="div-to-crop" style="">
          <div id="player-wrapper">
            <!-- 1. The <iframe> (and video 
            player) will replace this <div> 
            tag. -->
            <div id="player"></div>
          </div>
        </div>
      </div>
    </div>
    <script async src="/youtube-player.js"></script>
  </body>

  </html>

demo: here

original answer: here

Perhaps the code may be modified to only hide the bottom portion of the player only but that will still hide the player controls as well. It is worth mentioning that custom player controls can be made using the player.seek() methods from the iFrame API YouTube has.



来源:https://stackoverflow.com/questions/52962114/how-to-remove-more-video-from-youtube-embed

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!