0

I am facing one issue, When I am using youtube embedded code with its given iframe then it is showing related video and I want to hide that related video bar from iframe?

So is there any way to hide that related videos?

See my below image and code :

<iframe 
id="ytplayer" 
type="text/html" 
width="720" 
height="405"
src="https://www.youtube.com/embed/M7lc1UVf-VE?autoplay=1&controls=0&disablekb=1&fs=0&modestbranding=1&iv_load_policy=3";
frameborder="0" 
allowfullscreen>

enter image description here Also, I have used below code as well. but it is still showing more video links.

<iframe 
id="ytplayer" 
type="text/html" 
width="720" 
height="405"
src="https://www.youtube.com/embed/M7lc1UVf-VE?rel=0";
frameborder="0" 
allowfullscreen>
TrickStar
  • 201
  • 2
  • 16
  • Possible duplicate of [Youtube Javascript API - disable related videos](https://stackoverflow.com/questions/13418028/youtube-javascript-api-disable-related-videos) – Shan Eapen Koshy Nov 27 '18 at 14:27
  • no it's not the same, related video's are in the end. More video's are when you pause the content – Ewald Bos Mar 18 '19 at 12:31

2 Answers2

0

You have to use '?' when adding parameters to the url. Update the src with following

"https://www.youtube.com/embed/M7lc1UVf-VE?rel=0"
montu48
  • 26
  • 2
  • 5
  • 2
    Disabling related videos isn't possible anymore as the behaviour of "rel" has changed since September 25th 2018. Setting "rel=0" will load related videos from the same channel as that of the video. https://developers.google.com/youtube/player_parameters#rel – Shan Eapen Koshy Nov 27 '18 at 14:26
  • any solution there – Muneem Habib Feb 21 '19 at 08:33
0

you can hide it with css by using

.html5-endscreen{
display: none !important;
}
Umair Mehmood
  • 484
  • 8
  • 19