2 lines
2.5 KiB
JavaScript
2 lines
2.5 KiB
JavaScript
|
(self.webpackChunkant_design_pro=self.webpackChunkant_design_pro||[]).push([[7941],{97400:function(c){c.exports={videomodalbox:"videomodalbox___1O-Gk"}},7941:function(c,h,n){"use strict";n.r(h),n.d(h,{default:function(){return U}});var f=n(11849),B=n(34792),w=n(48086),Z=n(34895),O=n(28216),x=n(67294),j=n(5953),I=n.n(j),i=n(85893),C=n(67631),P=e=>((0,x.useEffect)(()=>{var d=e.fileType=="mp4"&&e.viewUrl&&!e.isM3u8?new(I())({container:document.getElementById("dplayervideo"+e.sourceID+"x"+e.showIndex),lang:"zh-cn",autoplay:!0,theme:"#722ed1",volume:.7,video:{url:e.viewUrl}}):new(I())({container:document.getElementById("dplayervideo"+e.sourceID+"x"+e.showIndex),lang:"zh-cn",autoplay:!0,theme:"#722ed1",volume:.7,video:{url:e.previewUrl||"",type:"customHls",customType:{customHls:function(a){var l=new C;l.loadSource(a.src),l.attachMedia(a)}}}});d.play(),window["video"+e.sourceID+"x"+e.showIndex]=d,setTimeout(function(){$("#dplayervideo"+e.sourceID+"x"+e.showIndex).removeClass("dplayer-hide-controller").addClass("dplayer-hide-controller")},2e3)},[]),(0,i.jsx)("div",{id:"dplayervideo"+e.sourceID+"x"+e.showIndex})),H=P,S=n(97400),T=n.n(S),y,p,U=(y=(0,O.$j)(e=>{var d=e.common;return{common:d}}),y(p=class extends x.PureComponent{constructor(){super(...arguments);this.state={modelZindex:100},this.getvideoinfo=()=>{var d=this.props,o=d.dispatch,a=d.sourceID,l=d.common,r=d.f,v=l.shareCode;o({type:"common/getFilePreview",payload:{busType:"cloud",sourceID:a,shareCode:v||void 0,f:r},callback:m=>{var t=m.data||{};this.setState({fileInfo:t}),(t==null?void 0:t.isM3u8)==0&&w.ZP.warning(intl.formatMessage({id:"storage-video-transingx"}))}})}}componentDidMount(){var d=this;d.getvideoinfo()}componentWillUnmount(){var d=this,o=d.props,a=o.dispatch,l=o.common,r=o.open,v=o.setOpenModel,m=o.videoOption,t=o.showIndex,D=o.issmall,u=l.sourceID;window["video"+u+"x"+t]&&window["video"+u+"x"+t].destroy()}render(){var d=this,o=d.props,a=o.dispatch,l=o.common,r=o.open,v=o.setOpenModel,m=o.videoOption,t=o.showIndex,D=o.issmall,u=l.sourceID,M=this.state,E=M.modelZindex,g=M.fileInfo,s=g===void 0?{}:g,F=z=>{d.setState({modelZindex:z})};return s!=null&&s.fileID?(0,i.jsx)(i.Fragment,{children:(0,i.jsx)(Z.Z,{open:r&&(s==null?void 0:s.name),modelZindex:E,setOpenModel:v,setModelZindex:F,type:"video",issmall:D,resolution:(s==null?void 0:s.resolution)||"",showIndex:t,title:s.name,children:(0,i.jsx)("div",{className:T().videomodalbox,children:s.fileID?(0,i.jsx)(H,(0,f.Z)((0,f.Z)({},s),{},{showIndex:t})):""})})}):""}})||p)}}]);
|