Announcement

Collapse
No announcement yet.

How to fix YouTube video embed autoplay and hide related videos outside of YouTube channel

Collapse
X
Collapse
First Prev Next Last
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Free Mod How to fix YouTube video embed autoplay and hide related videos outside of YouTube channel

    Auto-playing of YouTube videos embedded in posts used to work by having autoplay=1 in the embed URL. But auto-playing a video can be an unpleasant experience for users. That's why some browsers stopped autoplay from working unless the video is muted. This caused YouTube embed videos on vB5 to be clicked twice to play it. The first click is to load the actual YouTube embed video iframe and the second click is to play the video.

    To mute YouTube video embed, you need to pass mute=1 in the embed URL.

    To do this, do the following:
    1. Login to AdminCP.
    2. Navigate to Styles > Style Manager and find bbcode_video template and edit it.
    3. Append &mute=1 right after &autoplay=1. There are 2 instances of this for 'youtube' and 'youtube_share' providers.
    4. Save.
    5. Do the same steps above for other active styles/themes your forum is using.
    After doing this, you should be able to click a YouTube video once to load the actual embed video iframe and it'll automatically play and mute the video. The user has to explicitly unmute it if desired.

    When an embedded YouTube video is done playing, the YouTube player normally shows several related videos, also known as “suggested videos” or “more videos”. However, as a forum owner, you might want to hide the suggested videos that don't belong to the YouTube channel of the video that played. Unfortunately, there is no easy way to remove the suggested videos completely unless the origin channel has all videos unlisted. You can only filter it to only show videos from the same YouTube channel by simply adding rel=0 in the embed URL. Follow the same steps above to add &rel=0 to the embed URL.

    I have implemented both of these on this site. You can see it in action in the Featured Video module on homepage.
    Last edited by glennrocksvb; 11-29-2022, 12:58 PM.
    Helpful? Donate. Thanks!
    Buy me a coffeePayPal QR Code
    Fast VPS Host for vBulletin:
    A2 Hosting & IONOS

Users Viewing This Page

Collapse

There is 1 user viewing this forum topic.

  • Guest Guest

Latest Posts

Collapse

Working...
X
Searching...Please wait.
An unexpected error was returned: 'Your submission could not be processed because you have logged in since the previous page was loaded.

Please push the back button and reload the previous window.'
An unexpected error was returned: 'Your submission could not be processed because the token has expired.

Please push the back button and reload the previous window.'
An internal error has occurred and the module cannot be displayed.
There are no results that meet this criteria.
Search Result for "|||"