import{d as j,l as z,k as m,m as B,o as O,c as U,a as d,z as s,L as h,A as V,u as c,b as l,t as _,M as I}from"./vue.1703796278973.js";import{Z as D,a1 as N,k as $,W as A}from"./index.17037962789732.js";import"./index.170379627897337.js";import"./index.170379627897315.js";import"./index.1703796278973301.js";import"./index.170379627897320.js";import"./index.170379627897321.js";import{_ as J}from"./index.vue_vue_type_script_setup_true_lang.17037962789736.js";import{M as P}from"./mediaTool.1703796278973.js";import{c as i}from"./channel.1703796278973.js";import{_ as F}from"./_plugin-vue_export-helper.1703796278973.js";import"./index.17037962789733.js";import"./dayjs.min.1703796278973.js";import"./isArray.1703796278973.js";import"./editor.api.1703796278973.js";import"./preload-helper.1703796278973.js";import"./monaco.contribution.1703796278973.js";import"./system.1703796278973.js";import"./comm.1703796278973.js";import"./index.170379627897332.js";import"./index.170379627897333.js";import"./index.170379627897334.js";import"./default.1703796278973.js";import"./permission.1703796278973.js";import"./consts.1703796278973.js";import"./404.1703796278973.js";const H={class:"media-live"},W={class:"media-live-video"},Z={class:"media-tool"},q=["onClick"],E=["onClick"],G={class:"tool-item"},K={class:"media-live-tool"},Q=j({__name:"index",props:{visible:{type:Boolean,default:!1},data:{type:Object,default:()=>({})}},emits:["update:visible"],setup(y,{emit:b}){const e=y,n=z({get:()=>e.visible,set:t=>b("update:visible",t)}),k=m(),u=m(""),r=m("mp4"),v=()=>{u.value=i.ptzStart(e.data.deviceId,e.data.channelId,r.value)},o=m(0),x=async()=>{const{result:t}=await i.ptzIsRecord(e.data.deviceId,e.data.channelId);o.value=t?2:0},C=async()=>{o.value===0?(o.value=1,(await i.recordStart(e.data.deviceId,e.data.channelId,{local:!1})).success?o.value=2:o.value=0):o.value===2&&(await i.recordStop(e.data.deviceId,e.data.channelId,{local:!1})).success&&(o.value=0)},M=()=>{u.value="",setTimeout(()=>{v()},500)},w=async()=>{i.mediaStop(e.data.deviceId,e.data.channelId)},g=t=>{i.ptzTool(e.data.deviceId,e.data.channelId,t)},S=()=>{i.ptzStop(e.data.deviceId,e.data.channelId)};return B(()=>n.value,t=>{t?(v(),x()):u.value=""}),(t,a)=>{const R=D,f=N,T=$,L=A;return O(),U(L,{visible:c(n),"onUpdate:visible":a[1]||(a[1]=p=>I(n)?n.value=p:null),title:"播放",cancelText:"取消",okText:"确定",width:"800px",maskClosable:!1,onOk:a[2]||(a[2]=p=>n.value=!1),onCancel:a[3]||(a[3]=p=>n.value=!1)},{default:d(()=>[s("div",H,[s("div",W,[s("div",Z,[s("div",{class:"tool-item",onClick:h(C,["stop"])},V(c(o)===0?"开始录像":c(o)===1?"请求录像中":"停止录像"),9,q),s("div",{class:"tool-item",onClick:h(M,["stop"])}," 刷新 ",8,E),s("div",G,[l(R,{title:"重置将断开直播, 可能会影响其他播放者",onConfirm:w},{default:d(()=>[_(" 重置 ")]),_:1})])]),l(J,{ref_key:"player",ref:k,live:!0,url:c(u),protocol:c(r),autoplay:""},null,8,["url","protocol"])]),l(P,{onOnMouseDown:g,onOnMouseUp:S})]),s("div",K,[l(T,{value:c(r),"onUpdate:value":a[0]||(a[0]=p=>I(r)?r.value=p:null),"button-style":"solid",onChange:v},{default:d(()=>[l(f,{value:"mp4"},{default:d(()=>[_("MP4")]),_:1}),l(f,{value:"flv"},{default:d(()=>[_("FLV")]),_:1}),l(f,{value:"m3u8"},{default:d(()=>[_("HLS")]),_:1})]),_:1},8,["value"])])]),_:1},8,["visible"])}}});const Me=F(Q,[["__scopeId","data-v-ada6591e"]]);export{Me as default};
