MyBB Community Forums

Full Version: Alternate YouTube myCode?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Looking for an alternate YouTube myCode, so I can use [YouTube] on the forums to embed videos, but on the shoutbox, something like [YT]video link[/YT] and it outputs [Video Title] [uploaded by] [on date] [duration] [link]


Is this possible?
I've created youtube mycode with new youtube embed code and it's working fine —
\[youtube\]https://www.youtube.com/watch\?v\=(.*?)\[/youtube\]
<iframe width="560" height="315" src="https://www.youtube.com/embed/$1" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>

But for some reason, when I'm trying to create the same mycode but without "[youtube]" tags, it's not working...
https://www.youtube.com/watch\?v\=(.*?)
<iframe width="560" height="315" src="https://www.youtube.com/embed/$1" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
"Actual result" for this is
[Image: ARKHXvO.png]


For some reason it's adding video code after "iframe" tag. Why? What am I doing wrong? It isn't possible to use mycode without tags??
But it clearly say that "You must make sure the regular expression is valid and safe—no validation is performed.".
^ for above code regex, youtube tag needs to be used.
[youtube]url from youtube[/youtube]
Maybe there is some way how I can remove this mycode limitation? With editing some core files maybe? What file to search?
Because I need only youtube auto embedding with its URL, without any tags and without other media services,
so I don't want to install any mods, also I found a bug with automedia mod, so I don't want to use it, also I just noticed
that it adds extra js script to my site and I don't like software which use redundant js scripts.

I've installed Simple Audio Video Embeder it seems it's better and don't use any extra js scripts.