Video embed BBCode help

Get help developing custom BBCodes or request one.
Post Reply
prl
Registered User
Posts: 104
Joined: Tue Apr 14, 2009 8:13 pm

Video embed BBCode help

Post by prl »

Hello,

I have several BBCodes for embedding videos in my forum: YouTube, Vimeo and Facebook. To have the ability of the video resizing in a responsive manner this is the code I have (Facebook example):

BBCode usage

Code: Select all

[facebookvideo]{NUMBER1}[/facebookvideo]
HTML replacement

Code: Select all

<div style="max-width:640px;">
   <div style="position:relative; padding-bottom: 56.25%; height: 0;">
      <iframe src="https://www.facebook.com/plugins/video.php?href=https%3A%2F%2Fwww.facebook.com%2FWSL%2Fvideos%2F{NUMBER1}%2F&show_text=false" 
               style="border:none;overflow:hidden;position:absolute; top: 0; left: 0; width: 100%; height: 100%;" 
               scrolling="no" frameborder="0" allowTransparency="true" allowfullscreen="true">
      </iframe>
   </div>
</div>
This works well for videos in the standard "landscape" format because of that padding-bottom set to 56.25%, but I'd like to be able to adapt to different video heights. I've been trying this but to no success.

Does anyone have a solution for achieving that?

Thanks
prl
Registered User
Posts: 104
Joined: Tue Apr 14, 2009 8:13 pm

Re: Video embed BBCode help

Post by prl »

Any help? I'm still trying to embed FB videos in a responsive manner for any aspect ratio. Thanks
Post Reply

Return to “Custom BBCode Development and Requests”