2
* The Shadowbox Flash video player class.
4
* This file is part of Shadowbox.
6
* Shadowbox is an online media viewer application that supports all of the
7
* web's most popular media publishing formats. Shadowbox is written entirely
8
* in JavaScript and CSS and is highly customizable. Using Shadowbox, website
9
* authors can showcase a wide assortment of media in all major browsers without
10
* navigating users away from the linking page.
12
* Shadowbox is released under version 3.0 of the Creative Commons Attribution-
13
* Noncommercial-Share Alike license. This means that it is absolutely free
14
* for personal, noncommercial use provided that you 1) make attribution to the
15
* author and 2) release any derivative work under the same or a similar
18
* If you wish to use Shadowbox for commercial purposes, licensing information
19
* can be found at http://mjijackson.com/shadowbox/.
21
* @author Michael J. I. Jackson <mjijackson@gmail.com>
22
* @copyright 2007-2008 Michael J. I. Jackson
23
* @license http://creativecommons.org/licenses/by-nc-sa/3.0/
24
* @version SVN: $Id: shadowbox-flv.js 99 2008-05-11 16:22:43Z mjijackson $
34
* Constructor. This class is used to display Flash videos with the JW
37
* @param {String} id The id to use for this content
38
* @param {Object} obj The content object
41
Shadowbox.flv = function(id, obj){
45
// FLV's are resizable
46
this.resizable = true;
48
// height defaults to 300 pixels
49
this.height = this.obj.height ? parseInt(this.obj.height, 10) : 300;
50
if(SB.getOptions().showMovieControls == true){
51
this.height += 20; // height of JW FLV player controller
54
// width defaults to 300 pixels
55
this.width = this.obj.width ? parseInt(this.obj.width, 10) : 300;
58
Shadowbox.flv.prototype = {
61
* Returns an object containing the markup for this content, suitable
62
* to pass to Shadowbox.lib.createHTML().
64
* @param {Object} dims The current Shadowbox dimensions
65
* @return {Object} The markup for this content item
68
markup: function(dims){
71
// use resized dimensions
72
var h = dims.resize_h;
73
var w = dims.resize_w;
75
var options = SB.getOptions();
76
var autoplay = String(options.autoplayMovies);
77
var controls = options.showMovieControls;
78
var showicons = String(controls);
79
var displayheight = h - (controls ? 20 : 0); // subtract controller height
81
'file=' + this.obj.content,
84
'autostart=' + autoplay,
85
'displayheight=' + displayheight,
86
'showicons=' + showicons,
88
'frontcolor=0xCCCCCC',
96
type: 'application/x-shockwave-flash',
97
data: options.flvPlayer,
99
{ tag: 'param', name: 'movie', value: options.flvPlayer },
100
{ tag: 'param', name: 'flashvars', value: flashvars.join('&') },
101
{ tag: 'param', name: 'allowfullscreen', value: 'true' }
103
height: h, // new height includes controller
109
* Removes this movie from the document.
115
var el = SL.get(this.id);
116
if(el) SL.remove(el);