2 lines
1.6 KiB
JavaScript
2 lines
1.6 KiB
JavaScript
import{f as v}from"./flv.5f93b003.js";import{a as k,cE as M,r as u,f as m,G as b,af as h,H as V,J as g,k as w,aA as c,o as B,h as C,l as N,i as p,bl as E,p as _,x as F}from"./index.0af5f3c7.js";import I from"./LinkModal.85f153e9.js";import"./model-close-icon.706a0490.js";const $=k({name:"VideoFlv",components:{SvgIcon:M,LinkModal:I},props:{url:{type:String,default:null},screen:{type:Boolean,default:!0},name:{type:String,default:""}},setup(o){const n=u(null);let e=null;const d=u(o.url),a=u(!1),f=m(()=>o.name),i=m(()=>o.screen);function s(){if(!!o.url&&v.isSupported()){let S=w(n);var l=v.createPlayer({type:"flv",isLive:!0,url:o.url});l.attachMediaElement(S),l.load(),l.play(),e=l}}b(()=>{s()});function r(){i.value&&(a.value=!0)}function t(){!e||(e==null||e.pause(),e==null||e.unload(),e==null||e.detachMediaElement(),e==null||e.destroy(),e=null)}return h(()=>{t()}),V(()=>o.url,l=>{l&&(t(),s())}),{pName:f,onScreen:r,isScreen:i,pUrl:d,visibleModal:a,videoRef:n}}}),L={class:"w-full h-full relative"},U={class:"w-full"};function y(o,n,e,d,a,f){const i=c("SvgIcon"),s=c("VideoFlv",!0),r=c("LinkModal");return B(),C("div",L,[(o.isScreen,N("",!0)),p("video",{onClick:n[1]||(n[1]=E((...t)=>o.onScreen&&o.onScreen(...t),["prevent","stop"])),class:"w-full h-full",autoplay:"",controls:"",ref:"videoRef",muted:""},null,512),_(r,{visible:o.visibleModal,"onUpdate:visible":n[2]||(n[2]=t=>o.visibleModal=t),footer:null,title1:o.pName},{content:F(()=>[p("div",U,[_(s,{url:o.pUrl,screen:!1,name:o.pName},null,8,["url","name"])])]),_:1},8,["visible","title1"])])}var A=g($,[["render",y],["__scopeId","data-v-a8df41ba"]]);export{A as default};
|