2023-12-19 18:03:06 +08:00
|
|
|
import{P as q,I as J,_ as L,$ as H,a0 as K,x as Q,y as G,L as X,M as Y,O as Z,J as ee}from"./element-plus.5df6f736.js";import{_ as te}from"./index.vue_vue_type_script_setup_true_lang.4e44db35.js";import{u as se}from"./vue-router.ed788fee.js";import{o as m,c as f,a as t,L as C,ab as D,d as T,r as k,_ as j,T as i,K as u,U as M,S as v,Q as y,u as B,a6 as oe,J as F,R as V}from"./@vue.108c970a.js";import{d as ie,t as S}from"./index.eba5ee3f.js";import{a as ae}from"./useDictOptions.a0a89dbc.js";import{a as ne,b as A}from"./device.70cf9f56.js";import"./@vueuse.d3d080b7.js";import"./@element-plus.d6eabd08.js";import"./lodash-es.29c53eac.js";import"./dayjs.50c3b6f7.js";import"./axios.c2a2014a.js";import"./async-validator.fb49d0f5.js";import"./@ctrl.82a509e0.js";import"./@popperjs.36402333.js";import"./escape-html.e5dfadb9.js";import"./normalize-wheel-es.8aeb3683.js";import"./lodash.33f675f2.js";import"./pinia.eff1ffd5.js";import"./vue-demi.ebc8116b.js";import"./css-color-function.5d5b8bda.js";import"./color.da05fa89.js";import"./clone.06747a68.js";import"./color-convert.755d189f.js";import"./color-name.e7a4e1d3.js";import"./color-string.e356f5de.js";import"./balanced-match.d2a36341.js";import"./debug.1c707d7b.js";import"./ms.a9ae1d6d.js";import"./nprogress.fc605139.js";import"./vue-clipboard3.dc900a40.js";import"./clipboard.6beb87aa.js";import"./echarts.8d7a50ae.js";import"./zrender.1084fa23.js";import"./tslib.60310f1a.js";import"./highlight.js.4ebdf9a4.js";import"./@highlightjs.241b9b5d.js";const le={name:"VideoPlayer",props:{video_url:String},data(){return{jessibuca:null,version:"",wasm:!1,videoUrl:"",vc:"ff",playing:!1,quieting:!0,loaded:!1,showOperateBtns:!1,showBandwidth:!1,err:"",speed:0,performance:"",volume:1,rotate:0,useWCS:!1,useMSE:!0,useOffscreen:!1,recording:!1,recordType:"webm",scale:0}},mounted(){this.create(),this.videoUrl=this.video_url,window.onerror=l=>this.err=l,setTimeout(()=>{this.play()},2e3)},unmounted(){this.jessibuca.destroy()},methods:{create(l){l=l||{},this.jessibuca=new window.Jessibuca(Object.assign({container:this.$refs.container,videoBuffer:Number(this.$refs.buffer.value),isResize:!1,useWCS:this.useWCS,useMSE:this.useMSE,text:"",loadingText:"\u75AF\u72C2\u52A0\u8F7D\u4E2D...",debug:!1,decoder:"/decoder.js",supportDblclickFullscreen:!0,showBandwidth:this.showBandwidth,operateBtns:{fullscreen:this.showOperateBtns,screenshot:this.showOperateBtns,play:this.showOperateBtns,audio:this.showOperateBtns},vod:this.vod,forceNoOffscreen:!this.useOffscreen,isNotMute:!0,timeout:10},l));let o=this;this.jessibuca.on("load",function(){console.log("on load")}),this.jessibuca.on("log",function(e){console.log("on log",e)}),this.jessibuca.on("record",function(e){console.log("on record:",e)}),this.jessibuca.on("pause",function(){console.log("on pause"),o.playing=!1}),this.jessibuca.on("play",function(){console.log("on play"),o.playing=!0}),this.jessibuca.on("fullscreen",function(e){console.log("on fullscreen",e)}),this.jessibuca.on("mute",function(e){console.log("on mute",e),o.quieting=e}),this.jessibuca.on("mute",function(e){console.log("on mute2",e)}),this.jessibuca.on("audioInfo",function(e){console.log("audioInfo",e)}),this.jessibuca.on("videoInfo",function(e){console.log("videoInfo",e)}),this.jessibuca.on("error",function(e){console.log("error",e)}),this.jessibuca.on("timeout",function(){console.log("timeout")}),this.jessibuca.on("start",function(){console.log("frame start")}),this.jessibuca.on("performance",function(e){var a="\u5361\u987F";e===2?a="\u975E\u5E38\u6D41\u7545":e===1&&(a="\u6D41\u7545"),o.performance=a}),this.jessibuca.on("buffer",function(e){console.log("buffer",e)}),this.jessibuca.on("stats",function(e){console.log("stats",e)}),this.jessibuca.on("kBps",function(e){console.log("kBps",e)}),this.jessibuca.on("play",()=>{this.playing=!0,this.loaded=!0,this.quieting=this.jessibuca.isMute()}),this.jessibuca.on("recordingTimestamp",e=>{console.log("recordingTimestamp",e)})},play(){this.$refs.playUrl.value&&this.jessibuca.play(this.$refs.playUrl.value)},mute(){this.jessibuca.mute()},cancelMute(){this.jessi
|