Requirement: The wxParse plug-in can be used to parse HTML when displaying news content using wechat applets.
Problem: The wxParse plug-in plug-in cannot parse the Embed tag.
Detection method: Detect the data form of the video element in html2json.js, detect the data form of the embed tag to be converted, and obtain the video address in the embed tag to simulate the data form of the video element to generate a video.
Html2json (HTML, bindName) {} function html2json(HTML, bindName) {}
If (node.tag == "embed") {var embUrl = ""; setTimeout(function () {}, 1000) embUrl = node.attr.flashvars.substring(node.attr.flashvars.indexOf("\}") + 1, node.attr.flashvars.indexOf(".mp4")); embUrl = "http://qmcms.17el.cn/" + embUrl + '.mp4'; node = new Object(); node = { attr: { src: "", style: "width:100%", controls: "true" }, index: "0", node: "element", styleStr: "width:100%", tag: "video", tagType: "block" } node.attr.src = embUrl; }
Note: The video is too large and will be slow to load on the mobile end