archan937 / topup

The #1 Javascript Pop Up / Lightbox made by Paul Engel
http://gettopup.com
158 stars 32 forks source link

Close button shows up underneath Youtube video [Fix included!] #20

Open jpadvo opened 14 years ago

jpadvo commented 14 years ago

[I'm a noob. I learned about the ability to request a pull, so I did that with this code. Cheers! ]

When embedding a youtube video, the corner of the flash player cuts off the close button. This kind of problem is often fixed by setting the wmode of the embed to 'transparent,' but this can hurt the framerate of the video. It solves the problem and doesn't hurt the framerate to set the wmode to 'opaque.' If this is done in four places it solves the problem:

Starting at line 622:

object.append(jQuery("<embed></embed>").attr({
                                              src            : options.reference,
                                              width          : options.width,
                                              height         : options.height,
                                              wmode          : "opaque",     /* <-- RIGHT HERE */
                                              allowfullscreen: "true",
                                              type           : "application/x-shockwave-flash",
                                              pluginspage    : "http://get.adobe.com/flashplayer/"}));

Starting at line 645:

 object.append(jQuery("<embed></embed>").attr({
                                              src            : TopUp.host + TopUp.players_path + "flvplayer.swf", 
                                              width          : options.width,
                                              height         : options.height,
                                              wmode          : "opaque",      /* <-- RIGHT HERE */
                                              flashvars      : "file=" + options.reference + "&autostart=true",
                                              allowfullscreen: "true",
                                              type           : "application/x-shockwave-flash",
                                              pluginspage    : "http://get.adobe.com/flashplayer/"}));

Starting at line 671:

object.append(jQuery("<embed></embed>").attr({
                                              src        : options.reference,
                                              width      : options.width,
                                              height     : options.height,
                                              wmode      : "opaque",     /* <-- RIGHT HERE */
                                              scale      : "aspect", 
                                              bgcolor    : "black",
                                              showlogo   : "false", 
                                              autoplay   : "true",
                                              type       : "video/quicktime",
                                              pluginspage: "http://www.apple.com/quicktime/download/"}));

Starting at line 697:

object.append(jQuery("<embed></embed>").attr({
                                              src        : options.reference,
                                              width      : options.width,
                                              height     : options.height,
                                              wmode      : "opaque",     /* <-- RIGHT HERE */
                                              controls   : "imagewindow",
                                              console    : "one",
                                              autostart  : "true",
                                              nojava     : "true",
                                              type       : "audio/x-pn-realaudio-plugin",
                                              pluginspage: "http://www.real.com/freeplayer/?rppr=rnwk"}));