2 lines
2.6 KiB
JavaScript
2 lines
2.6 KiB
JavaScript
var h=(t,e,a)=>new Promise((r,d)=>{var l=o=>{try{n(a.next(o))}catch(s){d(s)}},c=o=>{try{n(a.throw(o))}catch(s){d(s)}},n=o=>o.done?r(o.value):Promise.resolve(o.value).then(l,c);n((a=a.apply(t,e)).next())});import{f as v}from"./flv.f1c8ebb0.js";import{a as w,bk as B,r as g,af as S,G as $,J as V,k as j,aA as _,o as f,j as k,x as u,i,h as A,l as y,p as E,y as b,t as p}from"./index.db467b02.js";import{C as N}from"./index.dced9e3b.js";import"./index.760d6a16.js";import"./index.99664453.js";import{S as x}from"./index.49b542c5.js";import{e as T}from"./other.1c300e90.js";import"./index.5c69846f.js";import"./index.6afbdc0a.js";import"./useRefs.efaa1d63.js";import"./PlusOutlined.4416e137.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 a=g(null),r=g(t.item.is_recommend==1);function d(){const{item:n}=t,o=n.extends.rtsp_url,s=`ws://${t.url}/rtsp?url=${window.btoa(o)}`;if(v.isSupported()){let C=j(a);var m=v.createPlayer({type:"flv",isLive:!0,url:s});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:a,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,a,r,d,l){const c=_("a-switch"),n=_("Tooltip"),o=_("Card");return f(),k(o,{hoverable:!0,class:"card",bodyStyle:{padding:0}},{cover:u(()=>[i("div",L,[t.item.is_recommend==1?(f(),A("div",M,"\u63A8\u8350")):y("",!0),i("div",R,[i("video",U,null,512)])])]),default:u(()=>[i("div",z,[i("div",D,[t.recommend?(f(),k(c,{key:0,"checked-children":"\u63A8\u8350\u5F00","un-checked-children":"\u63A8\u8350\u5173",checked:t.checked,"onUpdate:checked":e[0]||(e[0]=s=>t.checked=s),onChange:t.onChange},null,8,["checked","onChange"])):y("",!0)]),i("div",F,[E(n,{placement:"top"},{title:u(()=>[b(p(t.item.base_name)+"-"+p(t.item.monitoring_point),1)]),default:u(()=>[b(" "+p(t.item.base_name)+"-"+p(t.item.monitoring_point),1)]),_:1})])])]),_:1})}var te=V(I,[["render",G],["__scopeId","data-v-e5ea8ba8"]]);export{te as default};
|