YouTube embed showinfo has been deprecated

47,009

Solution 1

Directly from show info

Note: This is a deprecation announcement for the showinfo parameter. In addition, the behavior for the rel parameter is changing. Titles, channel information, and related videos are an important part of YouTube’s core user experience, and these changes help to make the YouTube viewing experience consistent across different platforms.

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.

It clearly states that this is something they consider to be part of the cor youtube experience. There is no suggestion of a workaround or a new parameter that you could send to archive the old results. They are removing it. If you tried to force it out using javascript and css i would almost suggest you are against the TOC which states your not allowed to change that display. People should know you are showing something from YouTube

Solution 2

If you need to hide the info, ideally go for Vimeo pro (which properly supports a no info embed),

Otherwise there is a simple workaround:

https://jsfiddle.net/10ov5hgw/1/

It cuts off the bottom & top 60px of the iframe, but via overflow rather than a gross looking black bar on top, so video still looks fullscreen the entire time (and barely any of the video is cutout if you force 720) ,

This hack supports having to support mobile views aswell, without heavily impacting the visible area of the video.

.video-container{
  width:100vw;
  height:100vh;
  overflow:hidden;
  position:relative;
}
.video-container iframe,{
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}
.video-container iframe, {
  pointer-events: none;
}
.video-container iframe{
  position: absolute;
  top: -60px;
  left: 0;
  width: 100%;
  height: calc(100% + 120px);
}
.video-foreground{
  pointer-events:none;
}

<div class="video-container" >
    <div class="video-foreground">
        <iframe
               src="https://www.youtube.com/embed/W0LHTWG-UmQ?controls=0&showinfo=0&rel=0&autoplay=1&loop=1&playlist=W0LHTWG-UmQ&mute=1"
               frameBorder="0" allowFullScreen>

        </iframe>
    </div>             
</div>                                        

Solution 3

The solution I found aesthetically most pleasing is to lay a high res thumbnail over the video and hide it at hover. This also deals with the problem that the youtube preview is low res and looks cheap in my opinion.

Check it out here: http://jsfiddle.net/d9D9E/1/

Had to write code in order to show the js fiddle :/

.video-thumbnail{
    z-index:300;
    position:absolute;
    top:0;
    left:0;
    width:100%;
}

.video-thumbnail:hover{
    display:none;
}

Solution 4

Not having 'rel=0' is irritating, but there is a work around. If you work with the IFrame API, (as opposed to embedding an iframe ex http://youtu.be/?videoIDxxx...) you can get the event for the stopping (completing) of the video, then cue up the video by ID into the player. See https://developers.google.com/youtube/iframe_api_reference#Playback_controls for reference to the basic player.

 
....

<div id="player1"></div>

<script type="text/javascript">
var tag = document.createElement('script');
tag.src = "https://www.youtube.com/iframe_api";
var firstScriptTag = document.getElementsByTagName('script')[0];
firstScriptTag.parentNode.insertBefore(tag, firstScriptTag);

var player ;

function onYouTubeIframeAPIReady()
    {
    player = new YT.Player('player1', 
        { 
        videoId: 'YourVideoId',
        events: {
            'onStateChange': onPlayerStateChange
             }
        });

    }; // onYOuTubeIframeAPIReady
    		
function onPlayerStateChange(event)
    { 
    // Alt approach //if( event.data  == 0){ location.reload()}
    if( event.data  == 0)
        { player.cueVideoById({videoId:'YourVideoID',
                               suggestedQuality: 'hd720'})
        };
    } 

     </script>

Solution 5

I was looking at the same problem and the only solution I found is to set the video in autoplay and place a transparent layer over the youtube box.

The user would not be able to interact with the player, but it can be useful in some situation like banner.

Unfortunately the code doesn't seem to run correctly on stackoverflow I also add a jsfiddle: http://jsfiddle.net/z3dqpuy0/

.yt-cntainer {
  position: relative;
}
		
.yt-mask {
  position: absolute;
	top: 0;
	bottom: 0;
	left: 0;
	right: 0;
}
<div class="yt-cntainer">
  <iframe id="vid-player-1" src="https://www.youtube.com/embed/Bey4XXJAqS8?enablejsapi=1&rel=0&controls=0&showinfo=0&autoplay=1" frameborder="0"></iframe>
  <div class="yt-mask"></div>
</div>
Share:
47,009
Daut
Author by

Daut

Frontend Software Engineer at Via

Updated on July 05, 2022

Comments

  • Daut
    Daut almost 2 years

    We are using a YouTube video on our website as a hero banner.

    However few days ago it started showing it's title, watch later button and a share button. We were able to hide them using &showinfo=0 at the end if the URL.

    I found out that showinfo has been deprecated and thus you can no longer hide the fact that it is a YouTube video showing there.

    Is there any other parameter that might be able to do the same thing?

    You cannot do it with CSS or JavaScript as it is an iframe.

    Any ideas are much appreciated.

    UPDATE:

    Any layer or mask over the video doesn't help, as the info shows when the video is loading, or if you click outside the browser, the video will pause and the info shows.

    Hiding the top ~60px works, but it is not a good solution for me.