NOTE: JW Box is no longer being actively maintained by LongTail Video, and is now a deprecated product. As such, we will not be providing support for issues relating to JW Box.
|
Click me! |
Click me!
|
Click me!
|
The internet can often feel like an endless source of distraction and interrupted thoughts. An act as simple as watching a video from start to finish can turn into a Herculean task. Why not hide the clutter on your screen and rid yourself of distractions? The JW Box, a lightbox designed specifically for the JW Player, expands your video (or image) and centers it against a darkened background for an optimal viewing experience.
In this tutorial you will learn how to:
We recommend placing these lines of HTML code in the <head> of your page, but any place before your first JW Box reference should be fine.
<script type="text/javascript" src="http://www.mydomain.com/jwbox/jquery.js"></script> <script type="text/javascript" src="http://www.mydomain.com/jwbox/jquery.jwbox.js"></script> <link rel="stylesheet" type="text/css" href="http://www.mydomain.com/jwbox/jwbox.css" />
The JW Box gives you complete control over your lightbox display. Specifically, it allows you to configure:
What follows are some examples with common JW Box configurations.
For a more detailed explanation of how JW Box works and the purpose of each element, see Anatomy of the JW Box.
JW Box was designed specifically for the JW Player, so formatting your player to display in the JW Box is both quick and easy. You will, however, need to be familiar with the practice of embedding video in your web page. If you don't know how to do so, or need a brief refresher, see our Embedding Flash tutorial.
To complete a standard embed, insert the following code in your web page. Make sure to replace the [Thumbnail URL] and [Video URL] variables with the appropriate values.
<div class="jwbox"> <img width="160" height="120" alt="JW Box Image" title="JW Box Image" src="[Thumbnail URL]"/> <div class="jwbox_hidden"> <div class="jwbox_content"> <object width="320" height="240" type="application/x-shockwave-flash" id="ply" name="ply" data="http://player.longtailvideo.com/player.swf"><param name="allowfullscreen" value="true"/><param name="allowscriptaccess" value="always"/><param name="flashvars" value="file=[Video URL]&image=[Thumbnail URL]"/></object> <p>Click the close button to return to the web page.</p> </div> </div> </div> <p>Click the image to display a player with a video in the JW Box.</p>
You should end up with something that looks like this:
Click the close button to return to the web page.
Click the image to display a player with a video in the JW Box.
It’s important to note that this example assumes that you haven't already embedded the JW Player in your page. If you have, then you don't need to insert the code supplied above. Simply replace the flashvars parameter with your own, then update the height and width.
Configuring the JW Box is very easy if you're already using SWFObject. Just change the <div> ID below to that of your current player.
<div class="jwbox"> <img width="160" height="120" alt="JW Box Image" title="JW Box Image" src="[Thumbnail URL]"/> <div class="jwbox_hidden"> <div class="jwbox_content"> <div id="myPlayer"></div> <p>Click the close button to return to the web page.</p> </div> </div> </div> <p>Click the image to display a player with a video in the JW Box.</p>
It's also possible to embed images using the JW Box. As before, you will need to enter the appropriate values for the [Image URL] and [Video URL] variables, where indicated in the example below.
<div class="jwbox"> <img width="160" height="120" alt="JW Box Image" title="JW Box Image" src="[Image URL]"/> <div class="jwbox_hidden"> <div class="jwbox_content"> <img alt="JW Box Image" title="JW Box Image" src="[Image URL]"/> <p>Click the close button to return to the web page.</p> </div> </div> </div> <p>Click the image to display the image in the JW Box.</p>
You'll end up with something that looks like this:
Click the close button to return to the web page.
Click the image to display the image in the JW Box.
The most powerful aspect of JW Box is its ability to display an arbitrary HTML in a lightbox. To do this, replace the [Default display HTML] and [Lightboxed HTML] below.
<div class="jwbox"> [Default display HTML] <div class="jwbox_hidden"> <div class="jwbox_content"> [Lightboxed HTML] </div> </div> </div> <p>Click the text to display some HTML in the JW Box.</p>
You'll end up with something that looks like this:
| 1 | 2 | 3 |
| 4 | 5 | 6 |
| 7 | 8 | 9 |
Click the close button to return to the web page.
Click the text to display some HTML in the JW Box.
Truly advanced JW Box users may want to alter the background color of the transparent overlay or the lightbox itself. This can be done by editing the jwbox.css style sheet directly.
<div class="jwbox"> [Default display HTML] <div class="jwbox_hidden"> <div class="jwbox_content"> [Lightboxed HTML] </div> </div> </div>
The JW Box contains the following elements: