1 |
- import{d as q,e as S,k as T,o as J,r as W,w as b,x as X,X as o,a6 as f,Y as u,u as s,aa as y,f as n,Z as r,E as A,F as H,a2 as Y,a7 as Z}from"./vue-bbe2430e.js";import{aJ as D,s as K,G as z,bu as O,a_ as Q,a0 as v,U as P,bj as ee,a3 as g,bk as te,V as se}from"./radical-d5778ee4.js";import{a as ae,u as oe,b as ne,V}from"./group-cb2f525f.js";const re={class:"text-center"},le={key:1,class:"video-player-placeholder"},ce=q({__name:"content",props:{type:{default:"device"}},setup(B){const l=B,F=ae(),c=oe(),i=S({get:()=>c.curScreenNum,set:t=>c.setCurScreenNum(t)}),L=[{label:"单屏",value:1},{label:"四分屏",value:4},{label:"九分屏",value:9},{label:"十六分屏",value:16}],G=S(()=>{switch(i.value){case 1:return 24;case 4:return 12;case 9:return 8;case 16:return 6;default:return 24}}),h=()=>document.querySelector(".screen-list"),w=T(null),{toggle:R,isFullscreen:C}=D(w),p=T(!1),M=()=>{try{if(typeof RTCRtpReceiver<"u"&&RTCRtpReceiver.getCapabilities){const t=RTCRtpReceiver.getCapabilities("video");t&&t.codecs&&t.codecs.some(e=>e.mimeType.toLowerCase().includes("h265")||e.mimeType.toLowerCase().includes("hevc"))||(p.value=!0)}else p.value=!0}catch(t){console.warn("检测 H265 支持时发生错误:",t),p.value=!0}};J(()=>{M()});const N=ne(l.type==="device");c.setMultiPlayRef(N);const{updateItem:x,streamList:I,resetStreamList:U,closeAll:$,webrtc:E}=N,d=W({selectNum:1});b(i,async()=>{d.selectNum=0,l.type==="device"?(c.setActiveInfo({parentId:"",parentName:"",deviceId:"",name:""}),F.setCurPlayGroupId(-2)):c.setActiveInfo({path:"",type:""});const t=new Array(i.value).fill({}).map(()=>l.type==="device"?{path:"",deviceItem:{},stream:void 0}:{path:"",type:"",streamItem:{},stream:void 0});await U(t)},{immediate:!0});let _=!1;const j=(t,a)=>{if(d.selectNum=a,l.type!=="stream"&&l.type==="device"&&t.deviceItem&&"deviceId"in t.deviceItem){const e=t.deviceItem;c.setActiveInfo({parentId:e.parentId??"",deviceId:e.deviceId??"",parentName:e.parentName??"",name:e.name??""}),_=!0}};X(()=>$());const{getActiveInfo:m}=K(c);return b(()=>{var t;return(t=m.value)==null?void 0:t.deviceId},()=>{if(l.type==="device"){const t=m.value,a=`${t.parentId}/${t.deviceId}`;if(I.some(e=>e.path===a)&&!_)return z.warn("当前设备已在分屏中!");x({path:a,deviceItem:t},d.selectNum)}_=!1}),b(()=>m.value.path,t=>{const a=m.value;if(l.type==="stream"&&t){if(I.some(e=>e.path===a.path))return z.warn("当前设备流已在分屏中!");x({path:a.path,streamItem:a},d.selectNum)}}),(t,a)=>(o(),f("div",re,[p.value?(o(),u(s(O),{key:0,type:"warning",message:"当前浏览器不支持 H265 解码",description:"如需观看 H265 视频请使用最新版的 Chrome 浏览器,确保显卡驱动已安装最新版本","show-icon":"",closable:"",class:"mb-12px",onClose:a[0]||(a[0]=e=>p.value=!1)})):y("",!0),n(s(Q),{value:i.value,"onUpdate:value":a[1]||(a[1]=e=>i.value=e),buttonStyle:"solid",options:L,optionType:"button"},null,8,["value"]),n(s(P),{onClick:s(R)},{default:r(()=>[n(s(v),{icon:"ant-design:fullscreen-outlined",class:"v-text-bottom"}),a[2]||(a[2]=A("全屏 "))]),_:1},8,["onClick"]),n(s(te),{gutter:4,class:"screen-list mt-10px",ref_key:"screenRef",ref:w},{default:r(()=>[s(C)?(o(),u(s(P),{key:0,onClick:s(R),type:"link",class:"absolute right-2 top-2 z-10 text-white"},{default:r(()=>[n(s(v),{icon:"ant-design:fullscreen-exit-outlined",class:"v-text-bottom"}),a[3]||(a[3]=A(" 退出全屏 "))]),_:1},8,["onClick"])):y("",!0),(o(!0),f(H,null,Y(s(I),(e,k)=>(o(),u(s(ee),{span:G.value,key:k,class:Z(["mt-4px flex-center",{active:i.value>1&&d.selectNum===k&&!s(C),isFullscreen:s(C)}]),onClick:()=>j(e,k)},{default:r(()=>["path"in e&&e.path?(o(),f(H,{key:0},[s(E)?(o(),u(V,{key:0,path:e.path,stream:e.stream},{default:r(()=>[e.path?(o(),u(s(g),{key:0,class:"position-absolute bottom-0 left-50% cursor-pointer",title:e.path,getPopupContainer:h},{default:r(()=>[n(s(v),{icon:"octicon:ellipsis-16",size:20,color:"#dedede",hoverColor:"#a275d9"})]),_:2},1032,["title"])):y("",!0)]),_:2},1032,["path","stream"])):(o(),u(V,{key:1,format:"ws-flv",path:e.path,stream:e.stream},{default:r(()=>[e.path?(o(),u(s(g),{key:0,class:"position-absolute bottom-0 left-50% cursor-pointer",title:e.path,getPopupContainer:h},{default:r(()=>[n(s(v),{icon:"octicon:ellipsis-16",size:20,color:"#dedede",hoverColor:"#a275d9"})]),_:2},1032,["title"])):y("",!0)]),_:2},1032,["path","stream"]))],64)):(o(),f("div",le,[n(s(g),{title:"当前无信号,请先选择通道",class:"no-stream-tip cursor-pointer",getPopupContainer:h,placement:"top"},{default:r(()=>[n(s(v),{icon:"pepicons-pop:television-play-off",size:i.value===1?50:24},null,8,["size"])]),_:1})]))]),_:2},1032,["span","class","onClick"]))),128))]),_:1},512)]))}});const de=se(ce,[["__scopeId","data-v-97a02355"]]);export{de as C};
|