简体   繁体   English

使用LightGallery在iframe中加载SWF文件?

[英]Loading swf file in iframe with LightGallery?

I am using lightGallery to load videos into an iframe that gets embeded in the lightgallery popup. 我正在使用lightGallery将视频加载到嵌入在lightgallery弹出窗口中的iframe中。

Problem is if I provide non-HTML5-videos for old browsers, using my own flash player, the iframe stays empty (black). 问题是,如果我使用自己的Flash Player为旧版浏览器提供非HTML5视频,则iframe会保持空白(黑色)。 If I open the video in a new tab, instead of lightgallery, it loads without any problem. 如果我在新标签页(而不是lightgallery)中打开视频,则加载时不会有任何问题。

The web developer console is empty, which is my biggest problem, since I cannot track down the error. Web开发人员控制台为空,这是我最大的问题,因为我无法跟踪该错误。 Note, everything is on the same domain. 注意,所有内容都在同一域中。

Example code from within the iframe: iframe中的示例代码:

<object id="videoPlayerObject" name="videoPlayerObject" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0" width="1021" height="770">
    <param name="movie" value="vid/video_player.swf">
    <param name="flashvars" value="flv=filename.flv&amp;width=1021&amp;height=770">
    <param name="allowScriptAccess" value="always">
    <param name="allowFullScreen" value="true">
    <param name="salign" value="lt">
    <embed id="videoPlayerEmbed" name="videoPlayerEmbed" src="vid/video_player.swf" flashvars="flv=filename.flv&amp;width=1021&amp;height=770" allowFullScreen="true" width="1021" height="770" allowScriptAccess="always" salign="lt" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer"></embed>
</object>

I have also tried swfobject, but the same problem. 我也尝试过swfobject,但是同样的问题。

Can anybody help me? 有谁能够帮助我? How can I find out more about the error? 如何找到有关该错误的更多信息? Unfortunately the developer is not answering on github. 不幸的是,开发人员没有在github上回答。


PS: I tried the same iframe embed with fancybox, there it works. PS:我尝试了嵌入fancybox的同一iframe,在这里可以工作。 So it must be lightgallery that has some problems with flash files. 因此,一定是lightgallery的Flash文件存在一些问题。

Got it working! 得到它的工作! Add wmode opaque to the object: 向对象添加wmode不透明:

<param name="wmode" value="opaque" />

Then it shows up! 然后它出现了!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM