2 lines
2.6 KiB
JavaScript
2 lines
2.6 KiB
JavaScript
var h=(t,e,s)=>new Promise((r,d)=>{var l=o=>{try{n(s.next(o))}catch(a){d(a)}},c=o=>{try{n(s.throw(o))}catch(a){d(a)}},n=o=>o.done?r(o.value):Promise.resolve(o.value).then(l,c);n((s=s.apply(t,e)).next())});import{f as v}from"./flv.8812aa56.js";import{a as w,bk as B,r as b,af as S,G as $,J as V,k as j,aA as _,o as f,j as g,x as u,i,h as A,l as k,p as E,y,t as p}from"./index.6f10b46a.js";import{C as N}from"./index.f979888c.js";import"./index.aedfb658.js";import"./index.1c81fdba.js";import{S as x}from"./index.001beb91.js";import{h as T}from"./other.a8016890.js";import"./index.3a1aa940.js";import"./index.fb26da79.js";import"./useRefs.79978461.js";import"./PlusOutlined.9d52d21d.js";const I=w({components:{Card:N,[x.name]:x,Tooltip:B},props:{item:{type:Object,default:()=>{}},url:{type:String},recommend:{type:Boolean,default:!0}},setup(t){let e=null;const s=b(null),r=b(t.item.is_recommend==1);function d(){const{item:n}=t,o=n.extends.rtsp_url,a=`ws://${t.url}/rtsp?url=${window.btoa(o)}`;if(v.isSupported()){let C=j(s);var m=v.createPlayer({type:"flv",isLive:!0,url:a});m.attachMediaElement(C),m.load(),m.play(),e=m}}function l(){!e||(e==null||e.pause(),e==null||e.unload(),e==null||e.detachMediaElement(),e==null||e.destroy(),e=null)}function c(n){return h(this,null,function*(){const o=n?1:0;yield T({id:t.item.id,is_recommend:o}),t.item.is_recommend=o})}return S(()=>{l()}),$(()=>{d()}),{videoRef:s,checked:r,onChange:c,data:t.item}}}),L={class:"bg-gray-200 pt-220/386 relative"},M={key:0,class:"absolute text-white px-6px py-2px rounded-2px z-99 text-12px bg-black bg-opacity-20 top-6px right-6px"},R={class:"absolute left-0 w-full top-0 h-full"},U={class:"w-full h-full",autoplay:"",controls:"",ref:"videoRef",muted:""},z={class:"px-10px"},D={class:"flex justify-end py-4px"},F={class:"line-clamp-2 h-48px"};function G(t,e,s,r,d,l){const c=_("a-switch"),n=_("Tooltip"),o=_("Card");return f(),g(o,{hoverable:!0,class:"card",bodyStyle:{padding:0}},{cover:u(()=>[i("div",L,[t.item.is_recommend==1?(f(),A("div",M,"\u63A8\u8350")):k("",!0),i("div",R,[i("video",U,null,512)])])]),default:u(()=>[i("div",z,[i("div",D,[t.recommend?(f(),g(c,{key:0,"checked-children":"\u63A8\u8350\u5F00","un-checked-children":"\u63A8\u8350\u5173",checked:t.checked,"onUpdate:checked":e[0]||(e[0]=a=>t.checked=a),onChange:t.onChange},null,8,["checked","onChange"])):k("",!0)]),i("div",F,[E(n,{placement:"top"},{title:u(()=>[y(p(t.item.base_name)+"-"+p(t.item.monitoring_point),1)]),default:u(()=>[y(" "+p(t.item.base_name)+"-"+p(t.item.monitoring_point),1)]),_:1})])])]),_:1})}var te=V(I,[["render",G],["__scopeId","data-v-4b3e1bb2"]]);export{te as default};
|