FCKeditor Insert video or video files

Source: Internet
Author: User
First, open separately: Editor/js/fckeditorcode_ie_1.js and/editor/js/fckeditorcode_gecko_1.js

Found it
Program code
C.src.endswith ('. SwF ', true)


To be replaced by:
Program code
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)


File formats you increase according to the actual situation.

Second, open/editor/dialog/fck_flash/fck_flash.js

1. Increase
Program code
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. Replace
Program code
E.type = ' Application/x-shockwave-flash ';

For
Program code
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. Replace
Program code
SetAttribute (E, ' type ', ' Application/x-shockwave-flash ');
SetAttribute (E, ' pluginspage ', ' http://www.macromedia.com/go/getflashplayer ');

For
Program code
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 ');
}

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.