公司运营平台的返回的视频使用的外部插件,以防被强制插入广告等风险,我需要提取其中的视频地址再以h5的video替换掉运营平台的video,之所以要采用替换是因为要保持其原有的位置。

const strDom='<div data-oembed-url="https://pic.ibaotu.com/00/62/20/763888piCJZy.mp4"> <div style="max-width:320px"><!-- You're using demo endpoint of Iframely API commercially. Max-width is limited to 320px. Please get your own API key at https://iframely.com. --> <div> <div style="height:0; left:0; padding-bottom:56.25%; position:relative; width:100%"><iframe allowfullscreen="" src="//if-cdn.com/ui5B0cP" style="border: 0; top: 0; left: 0; width: 100%; height: 100%; position: absolute;" tabindex="-1"></iframe></div> </div> <script async="" charset="utf-8" src="//if-cdn.com/embed.js"></script> </div> </div>';

const reg = /<div\s[^>]*data-oembed-url=\"([^">]+)\"[^>]*>/gi;
reg.exec(value);
const videoUrl = RegExp.$1;
const video = `<video controls playsinline src="${videoUrl}"></video>`;