使用Lightbox2来显示视频 [英] Using Lightbox2 to display video

查看:307
本文介绍了使用Lightbox2来显示视频的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

网站: http://blieque.comli.com/motion



在我开始之前,我知道Lightbox2(Lokesh Dhakar's)有许多替代方法来显示视频,但我想避免使用三种不同的JavaScript事物,因为我已经使用MooTools和JQuery HTTP请求到最低限度,以及磁盘使用情况。



实际上,Lightbox2不支持视频,句号。然而,我注意到JavaScript本质上是把 a href 属性的内容放在一个当灯箱打开时, img src 属性。就我所见,将 img 更改为 iframe (完成),并将锚标记的 href to youtube.com/embed/*video-id * 应该生成 iframe 包含该YouTube视频(用嵌入/ 替换 watch?id = )呈现视频的全屏版本。

然后,我还在默认的 class =lb-image现在当页面被加载并且Lightbox调用它时会创建一个空的窗口如果你检查了代码,你可以看到所有的属性都存在,但是框架中的页面没有被加载,只是创建一个空的 head body 标记。



我只是想知道这是一个服务器问题或代码问题,如果是这样,如何解决它。如果有什么办法让它工作?

谢谢



注意:我不使用Drupal,所以指示灯不亮视频选项不可用。 strong>



默认情况下,禁用视频支持。但是,可以通过检查admin / settings / lightbox2上的启用视频支持选项轻松启用此功能。


$ b

基本示例

 < a href =http://video.google.com/videoplay?docid=1811233136844420765 =lightvideo>此视频< ; / A> 

参考资料


Site: http://blieque.comli.com/motion

Before I start, I know there are many alternatives to Lightbox2 (Lokesh Dhakar's) to display videos but I want to avoid using three different JavaScript things, already using MooTools and JQuery as I'd like to keep HTTP requests to a minimum, as well as disk usage.

As it comes, Lightbox2 does not support videos, full stop. However, I noticed that the JavaScript was essentially taking the contents of an a's href attribute and placing it in an img's src attribute when the light-box was open. As far as I can see, changing this img to an iframe (done) and setting the anchor tag's href to youtube.com/embed/*video-id* should generate an iframe containing that YouTube video (replacing watch?id= with embed/ presents a full screen version of the video.

I then also added JavaScript for width, height and frameborder attributes on top of the default class="lb-image". Now when the page is loaded and the Lightbox called it creates an empty window. If you inspect the code you can see all the attributes are there but the page in the frame frame isn't loaded, just creating an empty head and body tag.

I was just wondering if it was a server problem or a code problem and if so, how to fix it. If there any way to make it work?

Thanks

Note: I'm NOT using Drupal so the lightvideo option is not available.

解决方案

Enabling video support

By default, support for videos is disabled. However, this can be easily enabled by checking the enable video support option on admin/settings/lightbox2.

Basic Example

<a href="http://video.google.com/videoplay?docid=1811233136844420765" rel="lightvideo">This Video</a>

Reference

这篇关于使用Lightbox2来显示视频的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆