Video_wev8.js 1.1 KB
define("Video_html",function(){return'<div id="NMEC_${id}" class="wev-comp-${compType}">    <video src="${url}" controls="controls" controlsList="nodownload" width="${width}" {@if autoplay == true}autoplay="autoplay" {@/if} {@if loop == true}loop="loop"{@/if}>        您的浏览器不支持 video 标签。    </video></div>'}),define(["mUtil","Component","docHelper"],function(d,o,a){return o.init(function(i){o.super(this,i),this.type="Video",this.tpl=this.type+"_html";var l=this.viewModel={autoplay:!0,loop:!0,width:"100%"};this.mounted=function(){var o=l.url||"",t=$("video",this.$el),e=function(i){t.attr("src",i)},n="/weaver/weaver.file.FileDownload?fileid=";isNaN(o)?0==o.indexOf(n)&&d.isIOS()&&d.runtime.isEmobile()&&s(o,e):a.convertDocidsToImageIds(o,function(i){i.length&&(o=n+i[i.length-1]),0==o.indexOf(n)&&d.isIOS()&&d.runtime.isEmobile()?s(o,e):e(o)})},this.pauseVideo=function(){this.$el.find("video")[0].pause()};var s=function(o,t){var i=d.getActionUrl("service.MobileCommon",{action:"getRequestURL"}),e="";d.ajax(i,null,function(i){1==i.status&&(e=i.ipaddr),t(e+o)},{type:"GET",dataType:"json",async:!0})}})});