将Wistia功能添加到LightGallery

时间:2015-07-28 21:02:47

标签: jquery wistia lightgallery

我有一个重大问题,我希望有人可以帮助我,或指出我正确的方向。

我围绕一个名为LightGallery的灯箱画廊建立了一个完整的网站 - (https://github.com/sachinchoolur/lightGallery

我正在使用的Vimeo视频工作正常,但是客户刚刚告诉我视频现在需要在Wistia上托管。

看到Wisita对Vimeo进行统计报告的好处是有道理的,但我没有丝毫的线索去做。我是一名前端设计师,曾在谷歌的帮助下成功。

这对我来说是难以实现的中等难度吗?或者我应该重新开始,寻找已经允许Wistia的插件?

提前感谢您提供的任何帮助。

最好的, NIC

1 个答案:

答案 0 :(得分:0)

Working with Wistia videos is going to be as easy as working with Vimeo (or similar).

Wistia allows you to embed the video in many different ways: using HTML5, Flash players, iframes... and LightGallery allows you to have one section as HTML, so just put your Wistia code to a hidden div (using display:none), and add it to LightGallery. Really simple, no?

Here is a quick example:

$(document).ready(function() {
    $("#lightGallery").lightGallery(); 
});
<div id="inlineSubHtml" style="display:none">
    <iframe src="http://fast.wistia.net/embed/iframe/479268413a" width="600" height="480"></iframe>
</div>

<ul id="lightGallery">
    <li data-src="http://lorempixel.com/200/200/people">
        <img src="http://lorempixel.com/200/200/people" />
    </li>
    <li data-src="http://lorempixel.com/200/200/nature">
        <img src="http://lorempixel.com/200/200/nature" />
    </li>
    <li data-sub-html="#inlineSubHtml">
        <img src="http://lorempixel.com/200/200/sports" />
    </li>
</ul>

You can see it working on this JSFiddle: http://jsfiddle.net/d71763ta/


Or even easier, according to the documentation:

Iframe support

Set attribute data-iframe=”true” to open the given ‘data-src’ in an iframe. You can display google map, external website etc. using this method

So if you use Wistia with an iframe (as above), you could add it directly as a section.