Wechat applet wxparse plug-in display video


Modify the wxparse / html2json.js file in the html2json (HTML, bindname) method


  var node = {
                node: 'element',
                tag: tag,

Here, use node.tag to get the label type, such as img, embed, video

Here my system background editor uses the ckedit to upload the video. The generated note is: Embed

So add judgment:

       if (node.tag =="embed"){

            var embUrl = node.attr.src;
            if (node.attr.src.indexOf('http:')==-1){
              embUrl = "http://xxxx.com" + node.attr.src; 
            node.attr.src = embUrl;


In the plug-in, only the video tag is judged, and the embedded tag is not recognized. All videos cannot be displayed. Add the judgment, and then it will be OK.