究竟如何才能插入视频呢

mp4格式视频,实在不行源码里引用也可以啊,能否提供一个简易的解决办法啊。看原编辑器支持video标签的啊?

请先 登录 后评论

4 个回答

过期罐头


请先 登录 后评论
张麻子

已经添加HTML.Allowed中的video[width|height|alt|src|style|class],但是还是不行

return [
    'encoding'  => 'UTF-8',
    'finalize'  => true,
    'cachePath' => storage_path('app/purifier'),
    'settings'  => [
        'default' => [
            'HTML.Doctype'             => 'XHTML 1.0 Transitional',
            'HTML.Allowed'             => 'div,b,font[color|style],strong,i,em,pre,a[href|title|target],ul,ol,li,p[style],br,span[style],img[width|height|alt|src|style|class],table[class|width],td,tr,blockquote,h1,h2,h3,h4,h4,h5,video[width|height|alt|src|style|class]',
            'CSS.AllowedProperties'    => 'font,font-size,width,height,font-weight,font-style,font-family,text-decoration,padding-left,color,background-color,text-align',
            'Attr.AllowedFrameTargets' =>'_blank',
            'AutoFormat.AutoParagraph' => true,
            'AutoFormat.RemoveEmpty'   => true,
        ],
        'test'    => [
            'Attr.EnableID' => true
        ],
        "youtube" => [
            "HTML.SafeIframe"      => 'true',
            "URI.SafeIframeRegexp" => "%^(http://|https://|//)(www.youtube.com/embed/|player.vimeo.com/video/)%",
        ],
    ],
];
请先 登录 后评论
不要脸的湿人

我不太明白的

请先 登录 后评论
宋登峰 - 官方技术支持
擅长:tipask,php,服务器,网站建设

因为我们的编辑器过滤是白名单的,所以video目前不自持。后面规则我们也在调整。

目前内容过滤的函数是 clean函数,你自己找一下控制器中对内容进行过滤的地方,把这个函数去掉即可。

请先 登录 后评论