www.satsig.net

Satellite Internet Forum.

Welcome, Guest. Welcome to anyone who has come from the Space forum. I can cope with one forum, but not two. The Space forum has been deleted       Forum rules.
      Home            Login            Register          
Pages: 1

Embedding YouTube video in YaBB forum

(Read 239312 times)
Admin1
YaBB Administrator
★★★★★
Offline



Posts: 1094
Jul 6th, 2013 at 10:21am  
Embedding YouTube video in my YaBB forum by forum Admin.



It took a while for me to learn how to do this.

When you are typing in your message you need to click on the tiny "Insert media" icon. This creates a couple of tags like so:
Code:
[media][/media] 


Between these two tags you need to enter the YouTube url for the video you want Like so:
Code:
[media]https://www.youtube.com/embed/iCzIi8Km5x4[/media] 



Use the url provided by youtube when you click on the Share/Embed option below the video.

If you have a YaBB forum then please note that to make this work you need to incorporate the following code in MediaCenter.pl instead of the existing youtube code.

Code:
$embed_youtube = qq~
    <iframe width="560" height="315" src="_media_" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
~;
 



Akso, insert an s line 35 like so:  (so http becomes https)
Code:
$media_url =~s~https$1:~media:~g;
 



It would be nice and more future proof if it were possible to simply insert the youtube embed text in between the two media. If you are perl coder and can fix this please tell me. The trouble seems to be that the existing code pulls the input text url apart, as it converted https to http before I added the extra s above.

Best regards, Eric
Back to top
« Last Edit: Aug 22nd, 2020 at 8:19pm by Admin1 »  
WWW  
IP Logged
 
Pages: 1