1 2 /** 3 * 4 * @description Engine to render an abstract data to pure HTML 5 * @constructor 6 * @class 7 * @version 0.1a 8 */ 9 function SntSwfobjectEmbed(){ 10 // error status, default is fine 11 this.status = true; 12 this.callback = null; 13 return this; 14 }; 15 16 SntSwfobjectEmbed.prototype = { 17 /** 18 * @function 19 * @description Set callback function 20 * @param fn callback function or null 21 * @return void 22 */ 23 setCallback : function(fn){ 24 this.callback = fn; 25 }, 26 /** 27 * @function 28 * @description Render all received data to object element with required params. 29 * This function used {@link SntEmbed#render} 30 * @param id Id of the holder 31 * @param swfMovie path to the swf 32 * @param size an array with two elements `width` and `height` with video holder size 33 * @param flashvars array with flashvars 34 * @param params array with parameters 35 * @param attributes an array with attributes 36 * @render status of the rendering 37 */ 38 render : function(id, swfMovie, size, flashvars, params, attributes){ 39 if(swfobject == null)return false; 40 if(this.callback != null){ 41 Sonettic.Helper.debug("Set callback method: " + this.callback) 42 swfobject.addLoadEvent(this.callback); 43 } 44 45 swfobject.embedSWF( 46 swfMovie, 47 id, 48 size.width, 49 size.height, 50 "9.0.0", 51 "scripts/expressInstall.swf", 52 flashvars, 53 params, 54 attributes 55 ); 56 57 return this.status; 58 } 59 }; 60 61