How To Hide Related Videos In YouTube Embeds (2019 Update)

Trang chủ / Các mẹo vặt và công cụ lập trình / How To Hide Related Videos In YouTube Embeds (2019 Update)

105 views

How To Hide Related Videos In YouTube Embeds (2019 Update)

When an embedded YouTube video is done playing, the YouTube player normally shows several related videos, also known as “suggested videos”. However, there are reasons a website owner might want these related videos not to show - due to branding preferences or simply wanting a cleaner user experience.

Before September 2018, a webmaster could disable related videos on YouTube embeds by simply adding ?rel=0 to the iframe’s src like this:

<iframe width="640" height="360" src="https://www.youtube.com/embed/0sDg2h3M1RE?rel=0" frameborder="0"></iframe>

However in September 2018, YouTube changed their embed code so that this rel=0 trick no longer fully disables related videos (instead it makes it so the related videos come from the same YouTube channel as the video displayed). It is no longer possible to fully disable related videos using rel=0.

This option was likely deprecated because it was not seeing a lot of use, but the sudden change has left the rest of us to wonder why rel=0 is not working to hide related videos like it used to. For those of us who still want to be able to embed YouTube videos without related videos showing at the end, there is a snippet of code we can use as a workaround. This is the final result (pay attention at the end of the video):

 


Chia sẻ với bạn bè của bạn!




© 2017 TEDU LEARNING AND ENTERTAINMENT

NGUYEN MINH HOANG  

01 LE LOI ST, WARD 1, MY THO CITY, TIEN GIANG PROVINCE
Email: minhhoangtgg@gmail.com | Mobile N0:
+84835.58.58.78

Website: https://tedu.edu.vn

Facebook: https://www.facebook.com/hoangminhisme

 

tedu footer