Advertisement:

Author Topic: [How to] Youtube video Responsive  (Read 2015 times)

Media DMJ

  • Jr. Member
  • **
  • Posts: 95
[How to] Youtube video Responsive
« on: June 04, 2014, 12:50:50 pm »
Easy way to Responsive youtube video using Youtube plugin.

Edit > plugins > youtube > item_detail.php

Replace
Code: [Select]
<?php if( isset($detail['s_youtube']) && !empty($detail['s_youtube']) ) { ?>
<div>
    <object width="425" height="344">
        <param name="movie" value="<?php echo trim($detail['s_youtube']) ; ?>"></param>
        <param name="allowFullScreen" value="true"></param>
        <param name="wmode" value="transparent"></param>
        <param name="allowScriptAccess" value="always"></param>
        <embed src="<?php echo $detail['s_youtube'] ; ?>"
          type="application/x-shockwave-flash"
          allowfullscreen="true"
          allowscriptaccess="always"
          wmode="transparent"
          width="425" height="344">
        </embed>
    </object>
</div>
<?php ?>

To
Code: [Select]
<?php if( isset($detail['s_youtube']) && !empty($detail['s_youtube']) ) { ?>
<style>
.video-container {
    position: relative;
    padding-bottom: 56.25%;
    padding-top: 30px; height: 0; overflow: hidden;
}
 
.video-container iframe,
.video-container object,
.video-container embed {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}
</style>
<div class="video-container">
    <object width="425" height="344">
        <param name="movie" value="<?php echo trim($detail['s_youtube']) ; ?>"></param>
        <param name="allowFullScreen" value="true"></param>
        <param name="wmode" value="transparent"></param>
        <param name="allowScriptAccess" value="always"></param>
        <embed src="<?php echo $detail['s_youtube'] ; ?>"
          type="application/x-shockwave-flash"
          allowfullscreen="true"
          allowscriptaccess="always"
          wmode="transparent"
          width="425" height="344">
        </embed>
    </object>
</div>
<?php ?>

Enjoy  8)

victorelectronics

  • Newbie
  • *
  • Posts: 3
  • xania.be
Re: [How to] Youtube video Responsive
« Reply #1 on: February 06, 2015, 12:54:48 pm »
Thanks !
works perfectly.

SmaRTeY

  • Osclass Hero
  • Hero Member
  • *
  • Posts: 2519
Re: [How to] Youtube video Responsive
« Reply #2 on: February 06, 2015, 04:49:40 pm »
Thanks Media DMJ!

mrtsoftware

  • Sr. Member
  • ****
  • Posts: 343
Re: [How to] Youtube video Responsive
« Reply #3 on: January 03, 2018, 08:25:30 pm »
Yes it works, video is responsive,
but when user try to publish ads, no option for " add video " ....Only into admin dasboard area this function viewable...

How to correct it? How users can also submit video inside their listings?