0

NOTE TO THE ABOVE COMMENT: This is NOT a duplicate question!

The above didn't resolve my issue; I already know about the opaque and transparent attributes ... my issue is assimilating them into the php code given.

I have a youtube video page that's overlapping my top navigational video. I've read that including the attribute wmode="opaque" will solve the issue.

But I'm unsure as to how to implement it within PHP.

The code that calls the video is:

  if ($showcase != ""):

    if (isset($_GET['entry'])) { 
        $iframe_src = 'http://www.youtube.com/v/' . $_GET['entry'] . '?version=3&
f=videos&app=youtube_gdata&autoplay=1';
    }
    else {
        $iframe_src = 'http://www.youtube.com/v/' . $showcase . '?version=3&
f=videos&app=youtube_gdata&autoplay=1';
    }

    $showcase_output = "<iframe height='" . $showcase_height . "' width='". 
$showcase_width . "' src='" . $iframe_src . "'></iframe>";

  endif;

Does anybody know how I can make these videos opaque, dynamically in php, so my top navigational menu overlaps the videos, instead of the other way around? I've searched for answers in the forums, but haven't figured out a solution yet. Thanks for any guidance anybody can offer!

Jason Weber
  • 5,653
  • 6
  • 40
  • 73
  • 1
    Also, you can clean up that string concatenation: `$showcase_output = "";` – Matt Ball Feb 26 '13 at 20:47
  • Hi Matt. I thought I looked at all the questions (that showed up in the right-hand column). I cleaned up that string, per your suggestion, and am now just trying to implement one of these solutions. Thanks for taking the time to help! – Jason Weber Feb 26 '13 at 21:02
  • I did look at that link, however, and none of those solutions worked ... I mean, I realize the wmode transparent/opaque attributes. My issues is with assimilating them properly into the php. – Jason Weber Feb 26 '13 at 21:17

2 Answers2

2
$iframe_src = 'http://www.youtube.com/v/' . $showcase . '?wmode=opaque&version=3&f=videos&app=youtube_gdata&autoplay=1';

should work.

user1452962
  • 386
  • 3
  • 8
  • hi User ... thank you for taking the time to respond! I tried this solution, but that didn't appear to solve anything, although you think it would ... I had originally put the &mode=opaque at the end, but putting it in the beginning didn't work either. Quite confounding! Thanks again for your time! – Jason Weber Feb 26 '13 at 21:00
1

You can do this :

$iframe_src .= (empty($iframe_src) ? '?' : '&').'wmode=opaque';
Philippe Boissonneault
  • 3,949
  • 3
  • 26
  • 33