发一个小技巧(帝国CMS7.5编辑器增加CK视频播放器),首先去下载CKplayer播放器,接着找到帝国这个文件\e\admin\ecmseditor\infoeditor\plugins\etranmedia\dialogs\etranmedia.js,
第一步,查找第二步,找到这段如下代码
- function etmediaViewFileCode(toplay,width,height,autostart,furl){
第三步,在上面代码下面增加代码
- else if(toplay==4)//flash
- {
- imgstr="<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0\" width=\""+width+"\" height=\""+height+"\"><param name=\"movie\" value=\""+furl+"\"><param name=\"quality\" value=\"high\"><embed src=\""+furl+"\" quality=\"high\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" type=\"application/x-shockwave-flash\" width=\""+width+"\" height=\""+height+"\"><param name=\"autoplay\" value=\""+autostart+"\" /></embed></object>";
- }
因为小编是把CKplayer放置在/e/m/下面的。请根据自身的目录结构引用JS
- else if(toplay==7)//CKPlayer
- {
- var uid = get_uid();
- var vid = "video-"+uid;
- var pid = "player-"+uid;
- var imgstr = '<script src="' + window.location.protocol + '//' + window.location.host + '/e/m/ckplayer/x/ckplayer.js" charset="utf-8" data-name="ckplayer"></script>';
- imgstr += '<div class="videoyuqi" style="width: ' + width + '; height: 500px;"></div>';
- imgstr += '<script type="text/javascript">';
- imgstr += 'var videoObject = {';
- imgstr += 'container: ".videoyuqi",';
- imgstr += 'variable: "player",';
- imgstr += 'poster: "../material/poster.jpg",';
- imgstr += 'htcrossorigin: "",';
- imgstr += 'crossdomain: "",';
- imgstr += 'video: "' + furl + '"';
- imgstr += '};';
- imgstr += 'var player = new ckplayer(videoObject);';
- imgstr += '</script>';
- }