[Mod] YouTube Video Card

Started by Deaks, Nov 17, 2026, 03:40 PM

Previous topic - Next topic

0 Members and 0 Guests are viewing this topic.

Deaks

YouTube Video Card v1.1.0
Give every video a title, a description and a conversation of its own.
By BoredSkull for SMF 2.1.x



When someone shares a tutorial, a trailer or a music video, the player only tells part of the story. YouTube Video Card brings the channel name, upload date, description and top YouTube comments into the forum post. Readers can check who made the video, expand the description or press play without leaving the topic.

Members keep using the familiar YouTube button and BBCode. The mod also picks up videos in existing posts, so your older topics benefit as soon as it's installed.



New in v1.1.0 — Let members choose what they see

Some readers want the description and comments beneath every video. Others prefer a compact card with just the essentials. You can now give members that choice while keeping control of what's available across the forum.

  • Enable personal preferences. Turn on Allow members to customise their video cards in Modification Settings. This option is off by default.
  • Choose which details appear. Under Profile → Modify Profile → YouTube Video Card, members can show or hide descriptions, comments, commenter profile pictures, view counts and like counts. They can also set their own comment limit.
  • Keep forum-wide settings in control. If you disable comments across the forum, a member's preference cannot turn them back on. Guests and members who haven't saved preferences see the forum defaults.
  • English and Finnish included. Both translations cover the new settings and member profile page.
  • Optional uninstall cleanup. Administrators can remove the video cache, saved member preferences and mod settings during uninstallation.
  • Updated SMF Credits. The credits entry now shows version 1.1.0.



What appears on a video card?

Without an API key, the card can display the embedded player and video title. With a YouTube Data API v3 key, you can also display:

  • Video details — Channel name, publication date, view count and likes.
  • Expandable description — Readers can select Show more to read the full description. Long descriptions stay folded away until someone wants them.
  • Top YouTube comments — Display comments beneath the player, with optional commenter profile pictures and a configurable comment limit.

The posting syntax stays the same:

[youtube]VIDEO_ID[/youtube]
There's no need to edit old posts or add a new editor button. If an existing embed still shows the original player after installation, go to Admin → Configuration → Server Settings → Cache → Empty the cache, then reload the topic.



Installation and setup

  • Open Admin → Packages → Download Packages → Upload Package, upload the ZIP and select Install Now. The mod uses SMF hooks and requires no manual theme edits.
  • Open Admin → Configuration → Modification Settings → YouTube Video Card. Choose the details you want to show across the forum and whether members can customise their own view.
  • For descriptions, statistics and comments, create or select a project in the Google Cloud Console and enable YouTube Data API v3.
  • Go to APIs & Services → Credentials, create an API key and restrict it to YouTube Data API v3. If your forum uses a fixed outbound IP address, you can also restrict the key to that address.
  • Paste the key into the mod's settings, save and open a topic containing a YouTube video to see the card.



Caching, privacy and playback

  • API usage. A typical lookup for video details and comments uses around two quota units. The default cache lasts six hours and can be adjusted, so repeated views of the same video reuse its details during that period.
  • Server-side requests. The forum fetches card data and keeps the API key on the server. Visitors receive the card details through your forum.
  • Privacy-enhanced player. Videos use [tt]youtube-nocookie.com[/tt]. YouTube comments appear as plain text, and links in descriptions use [tt]rel="nofollow ugc"[/tt].
  • Playback troubleshooting. If a card loads but the player refuses to play, check your forum's referrer policy. A site-wide [tt]Referrer-Policy: no-referrer[/tt] can prevent YouTube from receiving the referrer information it needs for embedded playback.



SMF Customisation Site status — awaiting approval
View YouTube Video Card on the SMF Customisation Site
  • 0 reactions

    Members who reacted


Deaks

Mod has been updated to 1.0.2 as a small bug was found in testing.
  • 0 reactions

    Members who reacted


Old Mellow

I think that I've found an error. I tried testing to see if boards could be restricted for guests. Then I saw this error:

Quotehttps://smf218.skhilled.com/index.php?action=admin;area=manageboards;sa=board2
/home/skhilled/public_html/smf218.skhilled.com/Sources/ManageBoards.php (Line 624)
Backtrace information

Type of error: Undefined
Error message Select
2: Undefined array key "boardid"

EDIT: I'm not sure if it is a SMF or a mod error...
  • 0 reactions

    Members who reacted


Deaks

not sure that is to do with the mod as it doesnt touch ManageBoards nor does it use boardid
  • 0 reactions

    Members who reacted


Old Mellow

Sorry, the backtrace info is:

#0: smf_error_handler()
Called from /home/skhilled/public_html/smf218.skhilled.com/Sources/ManageBoards.php on line 624
#1: EditBoard2()
Called from /home/skhilled/public_html/smf218.skhilled.com/Sources/Subs.php on line 6066
#2: call_helper()
Called from /home/skhilled/public_html/smf218.skhilled.com/Sources/ManageBoards.php on line 71
#3: ManageBoards()
Called from /home/skhilled/public_html/smf218.skhilled.com/Sources/Admin.php on line 499
#4: AdminMain()
Called from /home/skhilled/public_html/smf218.skhilled.com/index.php on line 191
  • 0 reactions

    Members who reacted


Deaks

none of them are used within this mod :/
  • 0 reactions

    Members who reacted


Old Mellow

Maybe it was a server glitch because I tried it again but didn't get the error.  :P
  • 0 reactions

    Members who reacted


Deaks

as it uses hooks it make no edits to any file :P
  • 0 reactions

    Members who reacted


Old Mellow

I was just looking at it on my cell and was thinking that maybe users could open/close the comments via an up/down switch? On a cell the comments can be very long, especially, on smaller cells.
  • 0 reactions

    Members who reacted


Deaks

remember in AP you can set how many comments from the cel to show :D
  • 0 reactions

    Members who reacted


Old Mellow

Yes, but that's for everyone. People like me don't always view the comments while others do. It would give users flexibility in how they would want to see them.
  • 0 reactions

    Members who reacted


Deaks

ill add to the roadmap :D
  • 👍 1

    Members who reacted


Old Mellow

I'm a former musician and DJ so I to there just for the music. Often times, I just set up a playlist and then go about doing other things. LOL

I have commented on some songs, though.
  • 0 reactions

    Members who reacted


Deaks

@Old Mellow your suggestion has been added into v1.1.0
  • 👍 1

    Members who reacted


Deaks

YouTube Video Card 1.1.0 Changelog
Changes since 1.0.2

  • Added Allow members to customise their video cards in Modification Settings. This option is off by default.
  • Added Profile → Modify Profile → YouTube Video Card. When enabled, members can show or hide video descriptions, comments, commenter profile pictures, and view and like counts. They can also set a personal comment limit.
  • Forum-wide settings take priority over personal preferences. Guests and members without saved preferences use the forum defaults.
  • Added English and Finnish translations for the new settings and profile page.
  • Added optional cleanup on uninstall for the video cache, saved preferences and mod settings.
  • Updated the SMF Credits entry to show version 1.1.0.
  • 0 reactions

    Members who reacted