// dynamically resolve the installation path if ( len(trim(attributes.basedir)) ) { objPath = createObject("component", "resolvepath").init(attributes.basedir); } else { objPath = createobject("component", "resolvepath").init(); } request.installdir = objPath.getURLPath(); request.playerpath = request.installdir & "/player/"; // sharing setup request.playerbaselink = getPageContext().getRequest().getScheme() & "://" & getPageContext().getRequest().getHeader("Host"); request.playerlink = getPageContext().getRequest().getRequestURL(); if ( len(trim(getPageContext().getRequest().getQueryString())) ) { request.playerlink = request.playerlink & getPageContext().getRequest().getQueryString(); } uid = createUUID(); // since most people would probably pass in the desired width and height of the 'video', let's account for the toolbar height auto-magically attributes.height = val(attributes.height) + 20; // if we're only playing a .mp3 file, then constraing the height to the player toolbar if no 'image' attribute has been passed if ( right(attributes.file, 4) eq ".mp3" and not len(trim(attributes.image)) ) { attributes.height = 20; } // height: minimum of 20px to display the player control bar only (i.e., for mp3 playback) if ( val(attributes.height) lt 20 ) { attributes.height = 20; } // width: minimum of 200px to display properly if ( val(attributes.width) lt 200 ) { attributes.width = 200; } if ( val(attributes.duration) lt 0 ) { attributes.duration = 0; } if ( val(attributes.volume) lt 0 ) { attributes.volume = 0; } else if ( val(attributes.volume) gt 100 ) { attributes.volume = 100; } // could also do this at the 'param' level, but this just seems cleaner if ( not isValid("regex", attributes.bgcolor, "[0-9A-Fa-f]{6}") ) { attributes.bgcolor = "ffffff"; } if ( not isValid("regex", attributes.bordercolor, "[0-9A-Fa-f]{6}") ) { attributes.bordercolor = "000000"; } if ( not isValid("regex", attributes.backcolor, "[0-9A-Fa-f]{6}") ) { attributes.backcolor = "ffffff"; } if ( not isValid("regex", attributes.frontcolor, "[0-9A-Fa-f]{6}") ) { attributes.frontcolor = "000000"; } if ( not isValid("regex", attributes.lightcolor, "[0-9A-Fa-f]{6}") ) { attributes.lightcolor = "000000"; } if ( not isValid("regex", attributes.screencolor, "[0-9A-Fa-f]{6}") ) { attributes.screencolor = "000000"; } if ( not isValid("url", attributes.link) ) { attributes.link = ""; } // enforce attribute options/choices if ( not listfindnocase(stretchingOptions, attributes.stretching, ",") ) { attributes.stretching = "uniform"; } if ( not listfindnocase(controlbarOptions, attributes.controlbar, ",") ) { attributes.controlbar = "bottom"; } if ( not listfindnocase(skinOptions, attributes.skin, ",") ) { attributes.skin = "default"; } if ( not listfindnocase(repeatOptions, attributes.repeat, ",") ) { attributes.repeat = "none"; } if ( not listfindnocase(playlistOptions, attributes.playlist, ",") ) { attributes.playlist = "none"; } if ( not listfindnocase(typeOptions, attributes.type, ",") ) { attributes.type = "none"; } if ( not listfindnocase(displayclickOptions, attributes.displayclick, ",") ) { attributes.displayclick = "play"; } if ( not listfindnocase(linktargetOptions, attributes.linktarget, ",") ) { attributes.linktarget = "_blank"; } if ( not listfindnocase(stateOptions, attributes.state, ",") ) { attributes.state = "idle"; } if ( not listfindnocase(playerOptions, attributes.player, ",") ) { attributes.player = "player.swf"; } if ( not listfindnocase(borderstyleOptions, attributes.borderstyle, ",") ) { attributes.borderstyle = "solid"; } if ( not listfindnocase(wmodeOptions, attributes.wmode, ",") ) { attributes.wmode = "opaque"; } // auto-fix display when using a playlist switch ( attributes.playlist ) { case "bottom" : { attributes.height += val(attributes.playlistsize); break; } case "right" : { attributes.width += val(attributes.playlistsize); break; } } if ( len(trim(attributes.hdfile)) ) { attributes.dock = true; attributes.plugins = attributes.plugins & ",hd-1"; } // sharing if ( attributes.sharecode or attributes.sharelink ) { attributes.dock = true; attributes.plugins = attributes.plugins & ",sharing-1"; } // clean up title attribute if ( len(trim(attributes.title)) ) { attributes.title = htmleditformat(attributes.title); attributes.title = rereplace(attributes.title, "'", "&##39;", "ALL"); } &stretching=#attributes.stretching#" />

#attributes.title#

This text will be replaced