Fckeditor插入视频或视频文件

来源:互联网 发布:淘宝网注册网店步骤 编辑:程序博客网 时间:2024/05/01 04:46
一、分别打开:editor/js/fckeditorcode_ie_1.js和/editor/js/fckeditorcode_gecko_1.js

找到
程序代码 程序代码

C.src.endsWith('.swf',true)


替换为:
程序代码 程序代码

C.src.endsWith('.swf',true) || C.src.endsWith('.mpg',true) || C.src.endsWith('.asf',true) || C.src.endsWith('.wma',true) || C.src.endsWith('.wmv',true) || C.src.endsWith('.avi',true) || C.src.endsWith('.mov',true) || C.src.endsWith('.mp3',true) || C.src.endsWith('.rm',true) || C.src.endsWith('.ra',true) || C.src.endsWith('.rmvb',true) || C.src.endsWith('.mid',true) || C.src.endsWith('.ram',true)


文件格式你根据实际情况增加。

二、打开/editor/dialog/fck_flash/fck_flash.js

1、增加
程序代码 程序代码

function WinPlayer(url){
    var r, re;
    re = /.(avi|wmv|asf|wma|mid|mp3|mpg)$/i;
    r = url.match(re);
    return r;
}

function RealPlayer(url){
    var r, re;
    re = /.(.rm|.ra|.rmvb|ram)$/i;
    r = url.match(re);
    return r;
}

function QuickTime(url){
    var r, re;
    re = /.(mov|qt)$/i;
    r = url.match(re);
    return r;
}

function FlashPlayer(url){
    var r, re;
    re = /.swf$/i;
    r = url.match(re);
    return r;
}


2、替换
程序代码 程序代码

e.type = 'application/x-shockwave-flash' ;


程序代码 程序代码

if(WinPlayer(GetE('txtUrl').value)!=null){
    e.type = 'application/x-mplayer2' ;
}
if(RealPlayer(GetE('txtUrl').value)!=null){
    e.type = 'audio/x-pn-realaudio-plugin' ;
}
if(QuickTime(GetE('txtUrl').value)!=null){
    e.type = 'video/quicktime' ;
}
if(FlashPlayer(GetE('txtUrl').value)!=null){
    e.type = 'application/x-shockwave-flash' ;
    e.pluginspage = '
http://www.macromedia.com/go/getflashplayer' ;
}


3、替换
程序代码 程序代码

SetAttribute( e, 'type', 'application/x-shockwave-flash' ) ;
SetAttribute( e, 'pluginspage'    , '
http://www.macromedia.com/go/getflashplayer' ) ;


程序代码 程序代码

if(WinPlayer(GetE('txtUrl').value)!=null){
    e.type = 'application/x-mplayer2' ;
    SetAttribute( e, 'autostart', GetE('chkAutoPlay').checked ? 'true' : 'false' ) ;
}
if(RealPlayer(GetE('txtUrl').value)!=null){
    e.type = 'audio/x-pn-realaudio-plugin' ;
    SetAttribute( e, 'autostart', GetE('chkAutoPlay').checked ? 'true' : 'false' ) ;
}
if(QuickTime(GetE('txtUrl').value)!=null){
    e.type = 'video/quicktime' ;
    SetAttribute( e, 'autostart', GetE('chkAutoPlay').checked ? 'true' : 'false' ) ;
}
if(FlashPlayer(GetE('txtUrl').value)!=null){
    e.type = 'application/x-shockwave-flash' ;
    SetAttribute( e, 'scale', GetE('cmbScale').value ) ;
    SetAttribute( e, 'menu', GetE('chkMenu').checked ? 'true' : 'false' );
    SetAttribute( e, 'play', GetE('chkAutoPlay').checked ? 'true' : 'false' ) ;

 
原创粉丝点击