1// JavaScript Document 2 3/** 4 * The Shadowbox Flash video player class. 5 * 6 * This file is part of Shadowbox. 7 * 8 * Shadowbox is an online media viewer application that supports all of the 9 * web's most popular media publishing formats. Shadowbox is written entirely 10 * in JavaScript and CSS and is highly customizable. Using Shadowbox, website 11 * authors can showcase a wide assortment of media in all major browsers without 12 * navigating users away from the linking page. 13 * 14 * Shadowbox is released under version 3.0 of the Creative Commons Attribution- 15 * Noncommercial-Share Alike license. This means that it is absolutely free 16 * for personal, noncommercial use provided that you 1) make attribution to the 17 * author and 2) release any derivative work under the same or a similar 18 * license. 19 * 20 * If you wish to use Shadowbox for commercial purposes, licensing information 21 * can be found at http://mjijackson.com/shadowbox/. 22 * 23 * @author Michael J. I. Jackson <[email protected]> 24 * @copyright 2007-2008 Michael J. I. Jackson 25 * @license http://creativecommons.org/licenses/by-nc-sa/3.0/ 26 * @version SVN: $Id: shadowbox-flv.js 99 2008-05-11 16:22:43Z mjijackson $ 27 */ 28 29(function(){ 30 31 // shorthand 32 var SB = Shadowbox; 33 var SL = SB.lib; 34 35 /** 36 * Constructor. This class is used to display Flash videos with the JW 37 * FLV player. 38 * 39 * @param {String} id The id to use for this content 40 * @param {Object} obj The content object 41 * @public 42 */ 43 Shadowbox.flv = function(id, obj){ 44 this.id = id; 45 this.obj = obj; 46 47 // FLV's are resizable 48 this.resizable = true; 49 50 // height defaults to 300 pixels 51 this.height = this.obj.height ? parseInt(this.obj.height, 10) : 300; 52 if(SB.getOptions().showMovieControls == true){ 53 this.height += 20; // height of JW FLV player controller 54 } 55 56 // width defaults to 300 pixels 57 this.width = this.obj.width ? parseInt(this.obj.width, 10) : 300; 58 }; 59 60 Shadowbox.flv.prototype = { 61 62 /**
63 * Returns an object containing the markup for this content, suitable 64 * to pass to Shadowbox.lib.createHTML(). 65 * 66 * @param {Object} dims The current Shadowbox dimensions 67 * @return {Object} The markup for this content item 68 * @public 69 */ 70 markup: function(dims){ 71 var obj = this.obj; 72 73 // use resized dimensions 74 var h = dims.resize_h; 75 var w = dims.resize_w; 76 77 var options = SB.getOptions(); 78 var autoplay = String(options.autoplayMovies); 79 var controls = options.showMovieControls; 80 var showicons = String(controls); 81 var displayheight = h - (controls ? 20 : 0); // subtract controller height 82 // LINKEO FLASHVARS 83 var skin = options.skinUrl; 84 var scale = options.modeScale; 85 var preview = options.preview; 86 var nomEntreprise = options.nomEntreprise; 87 var commentEntreprise = options.commentEntreprise; 88 var texteFacultatif = options.texteFacultatif; 89 90 var flashvars = [ 91 'file=' + this.obj.content, 92 'height=' + h, 93 'width=' + w, 94 'autostart=' + autoplay, 95 'displayheight=' + displayheight, 96 'showicons=' + showicons, 97 'backcolor=0x000000', 98 'frontcolor=0xCCCCCC', 99 'lightcolor=0x557722', 100 'skinUrl=' + skin, 101 'modeScale=' + scale, 102 'previewImg=' + preview, 103 'nomEntreprise=' + nomEntreprise, 104 'commentEntreprise=' + commentEntreprise, 105 'texteFacultatif=' + texteFacultatif 106 ]; 107 108 return { 109 tag: 'object', 110 id: this.id, 111 name: this.id, 112 type: 'application/x-shockwave-flash', 113 data: options.flvPlayer, 114 children: [ 115 { tag: 'param', name: 'movie', value: options.flvPlayer }, 116 { tag: 'param', name: 'flashvars', value: flashvars.join('&') }, 117 { tag: 'param', name: 'allowfullscreen', value: 'true' }, 118 { tag: 'param', name: 'allowScriptAccess ', value: 'always' } 119 ], 120 height: h, // new height includes controller 121 width: w 122 }; 123 }, 124 125 /** 126 * Removes this movie from the document. 127 * 128 * @return void 129 * @public 130 */ 131 remove: function(){ 132 var el = SL.get(this.id); 133 if(el) SL.remove(el); 134 } 135 136 }; 137 138})();
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.