/** * 使用超酷播放器初始化 * @param option * @private */ function _initByCkplayer(option) { require(["ckplayer"], function (ck) { var params = {bgcolor: '#000', allowFullScreen: true, allowScriptAccess: 'always', wmode: 'transparent'}; ck.embedSWF(contextPath + '/js/lib/ckplayer/ckplayer.swf', option.id, 'ckplayer_a1', option.width, option.height, { f: option.url, c: 0, p: 2, loaded: 'loadedHandler', i: contextPath + '/js/lib/ckplayer/start.jpg' }, params); }) } /** * 使用swfobject初始化 * @param option * @private */ function _initBySwfobject(option) { require(["swfobject"], function () { var so = new SWFObject(contextPath + "/js/lib/swfobject/CuPlayerMiniV4.swf", "CuPlayerV4", option.width, option.height, "9", "#000000"); so.addParam("allowfullscreen", "true"); so.addParam("allowscriptaccess", "always"); so.addParam("wmode", "opaque"); so.addParam("quality", "high"); so.addParam("salign", "lt"); so.addVariable("CuPlayerSetFile", contextPath + "/js/lib/swfobject/CuPlayerSetFile.xml"); //播放器配置文件地址,例SetFile.xml、SetFile.asp、SetFile.php、SetFile.aspx so.addVariable("CuPlayerFile", option.url); //视频文件地址 so.addVariable("CuPlayerImage", contextPath + "/images/start.jpg");//视频略缩图,本图片文件必须正确 so.addVariable("CuPlayerWidth", option.width); //视频宽度 so.addVariable("CuPlayerHeight", option.height); //视频高度 so.addVariable("CuPlayerAutoPlay", "no"); //是否自动播放 so.write(option.id); }); }