BBCode Youtube marker

Get help developing custom BBCodes or request one.
Post Reply
hrx
Registered User
Posts: 229
Joined: Wed Nov 18, 2015 11:21 am
Location: PL

BBCode Youtube marker

Post by hrx »

Hi,

I have such a bbcode youtube tag created on the forum:

Code: Select all

[youtube]{IDENTIFIER}://youtu.be/{SIMPLETEXT}[/youtube]

<iframe width="560" height="315" src="{IDENTIFIER}://www.youtube.com/embed/{SIMPLETEXT}" frameborder="0" allowfullscreen></iframe>

Youtube: [youtube]https://youtu.be/[/youtube]
The added short link "youtu.be" in the topic will automatically change to embedded video, but unfortunately the long link will not automatically change to the embedded video. How to fix it?

The short link will change to embedded video:

https://youtu.be/W9P_qUnMaFg

The long link will not change to embedded video:

https://www.youtube.com/watch?v=W9P_qUnMaFg
Last edited by hrx on Mon Sep 24, 2018 11:34 am, edited 1 time in total.
User avatar
KevC
Support Team Member
Support Team Member
Posts: 72329
Joined: Fri Jun 04, 2004 10:44 am
Location: Oxford, UK
Contact:

Re: BBCode Youtube marker

Post by KevC »

Just use the media extension.
https://www.phpbb.com/customise/db/exte ... ediaembed/

It does it all for you regardless of the link and works on tons of other media links as well. No coding needed.
-:|:- Support Request Template -:|:-
Image
"Step up to red alert. Sir, are you absolutely sure? It does mean changing the bulb"
hrx
Registered User
Posts: 229
Joined: Wed Nov 18, 2015 11:21 am
Location: PL

Re: BBCode Youtube marker

Post by hrx »

Thanks for the information. :)
Post Reply

Return to “Custom BBCode Development and Requests”