video

插入图片插件
KISSY.use('editor',function(S,Editor){
    S.use('editor/plugin/video',function(S,plugin){
        // use
    });
});

Configs

Editor.Plugin.video.config.urlCfg
Editor.Plugin.video.config.urlTip
Editor.Plugin.video.config.providers

Events

Commands

Config Details

Editor.Plugin.video.config.urlCfg

{Object[]} - 动态地址转化规则,其中每个 Object 包括

Editor.Plugin.video.config.urlCfg.reg

{RegExp} - 判断匹配与否的正则

Editor.Plugin.video.config.urlCfg.url

{RegExp} - 转化服务器的地址

Editor.Plugin.video.config.urlCfg.paramName

{String} - 待转化 url 的参数名称

Editor.Plugin.video.config.urlTip

{String} - 输入框提示信息

Editor.Plugin.video.config.providers

{Object[]} - 静态转换规则, 从用户输入转换为flash地址,其中每个 Object 包括

Editor.Plugin.video.config.providers.reg

{RegExp} - 判断匹配与否的正则

Editor.Plugin.video.config.providers.width

{Number} - 转化后 flash 的默认宽度

Editor.Plugin.video.config.providers.height

{Number} - 转化后 flash 的默认高度

Editor.Plugin.video.config.providers.detect(url)

{function} - 转化函数,参数为用户输入的 url

实例

{
    "video": {
        urlCfg: [
            {
                reg:/tudou\.com/i,
                url:"http://bangpai.daily.taobao.net/json/getTudouVideo.htm",
                paramName:"url"
            }
        ],
        // 输入框提示信息
        urlTip: "请输入优酷网、土豆网、酷7网的视频播放页链接...",
        // 静态转换规则, 从用户输入转换为flash地址, 例如优酷:
        providers: [
            {
                // 允许白名单
                reg:/taohua\.com/i,
                //默认高宽
                width:480,
                height:400,
                detect:function (url) {
                    return url;
                }
            },
            {
                reg:/youku\.com/i,
                width:480,
                height:400,
                detect:function (url) {
                    var m = url.match(/id_([^.]+)\.html(\?[^?]+)?$/);
                    if (m) {
                        return "http://player.youku.com/player.php/sid/" + m[1] + "/v.swf";
                    }
                    m = url.match(/v_playlist\/([^.]+)\.html$/);
                    if (m) {
                        return;
                        //return "http://player.youku.com/player.php/sid/" + m[1] + "/v.swf";
                    }
                    return url;
                }
            },
            {
                reg:/tudou\.com/i,
                width:480,
                height:400,
                detect:function (url) {
                    return url;
                }
            },
            {
                reg:/ku6\.com/i,
                width:480,
                height:400,
                detect:function (url) {
                    var m = url.match(/show[^\/]*\/([^\/]+)\.html(\?[^?]+)?$/);
                    if (m) {
                        return "http://player.ku6.com/refer/" + m[1] + "/v.swf";
                    }
                    return url;
                }
            }
        ]
    }
}