anxiao_web/iframe/video/js/h5splayer.js

1 line
44 KiB
JavaScript
Raw Normal View History

2024-07-24 09:22:32 +08:00
function createRTCSessionDescription(t){return new RTCSessionDescription(t)}var gStrH5SPlayerVersion="h5splayer r15.0.1025";function H5sPlayerWS(t){this.sourceBuffer,this.buffer=[],this.t,this.video,this.s,this.i,this.o,this.h=0,this.l=0,this.u=0,this.S=!1,this.v=!1,this.C=!1,this.H,this.p=1,this.P=!0,void 0!==t.consolelog&&"false"===t.consolelog&&(this.P=!1),this.R=t,!0===this.P&&console.log("[WS] Websocket Conf:",t),this.k=t.videoid,this.W=t.pbconf,this.T=t.token,void 0===this.k?(this.m=t.videodom,!0===this.P&&console.log("[WS] use dom directly",t.token)):(this.m=document.getElementById(this.k),!0===this.P&&console.log("[WS] use videoid",t.token)),void 0!=this.m.I&&(!0===this.P&&console.log("[WS] set latencyHint to 0"),this.m.I=0),this.video=this.m,this.A,void 0!=this.W&&"false"==this.W.showposter?(this.A=this.R.protocol+"//"+this.R.host+this.R.rootpath+"api/v1/GetLoadingImage?session="+this.R.session+"&refresh="+Math.floor(1e6*Math.random()),!0===this.P&&console.log("[WS] connect src",t.token),this.m.setAttribute("poster",this.A)):(this.A=this.R.protocol+"//"+this.R.host+this.R.rootpath+"api/v1/GetImage?token="+this.T+"&session="+this.R.session+"&refresh="+Math.floor(1e6*Math.random()),!0===this.P&&console.log("[WS] connect src",t.token),this.m.setAttribute("poster",this.A))}function H5sPlayerRTC(t){this.s,this.o,this.S=!1,this.v=!1,this.P=!0,void 0!==t.consolelog&&"false"===t.consolelog&&(this.P=!1),this.R=t,this.k=t.videoid,this.W=t.pbconf,this.T=t.token,this.p=1,void 0===this.k?(this.m=t.videodom,!0===this.P&&console.log("[RTC] use dom directly",t.token)):(this.m=document.getElementById(this.k),!0===this.P&&console.log("[RTC] use videoid",t.token)),this.video=this.m,this.M=null,this.U={optional:[{DtlsSrtpKeyAgreement:!0}]},this.O={mandatory:{offerToReceiveAudio:!0,offerToReceiveVideo:!0}},this.g={iceServers:[]},this.N=[],this.A,void 0!=this.W&&"false"==this.W.showposter?(this.A=this.R.protocol+"//"+this.R.host+this.R.rootpath+"api/v1/GetLoadingImage?session="+this.R.session+"&refresh="+Math.floor(1e6*Math.random()),!0===this.P&&console.log("[WS] connect src",t.token),this.m.setAttribute("poster",this.A)):(this.A=this.R.protocol+"//"+this.R.host+this.R.rootpath+"api/v1/GetImage?token="+this.T+"&session="+this.R.session+"&refresh="+Math.floor(1e6*Math.random()),!0===this.P&&console.log("[WS] connect src",t.token),this.m.setAttribute("poster",this.A))}function H5sPlayerHls(t){this.s,this.o,this.R=t,this.k=t.videoid,this.T=t.token,this.J,this.F=t.hlsver,this.P=!0,void 0!==t.consolelog&&"false"===t.consolelog&&(this.P=!1),void 0===this.k?(this.m=t.videodom,!0===this.P&&console.log("[HLS] use dom directly",t.token)):(this.m=document.getElementById(this.k),!0===this.P&&console.log("[HLS] use videoid",t.token)),this.D=this.m,this.D.type="application/x-mpegURL",this._=0,this.L=0;var s=this.R.protocol+"//"+window.location.host+"/api/v1/GetImage?token="+this.T+"&session="+this.R.session;this.m.setAttribute("poster",s)}function H5sPlayerAudio(t){this.buffer=[],this.s,this.S=!1,this.v=!1,this.R=t,this.P=!0,void 0!==t.consolelog&&"false"===t.consolelog&&(this.P=!1),!0===this.P&&console.log("[AUD] Aduio Player Conf:",t),this.T=t.token,this.B=new AudioContext}function H5sPlayerAudBack(t){this.buffer=[],this.s,this.S=!1,this.v=!1,this.R=t,this.K=0,this.V=48e3,this.G=!1,this.P=!0,void 0!==t.consolelog&&"false"===t.consolelog&&(this.P=!1),!0===this.P&&console.log("[AUDBACK] Aduio Back Conf:",t),this.T=t.token,this.B=new AudioContext,!0===this.P&&console.log("[AUDBACK] sampleRate",this.B.sampleRate),this.j()}function float32ToInt16(t){for(var s=t.length,e=new Int16Array(s);s--;)e[s]=32767*Math.min(1,t[s]);return e}function H5sConference(t){this.s,this.o,this.S=!1,this.v=!1,this.q=!1,this.X,this.Y,this.Z=!1,this.$=!1,this.tt,this.st,this.et=[],this.it=[],this.P=!0,void 0!==t.consolelog&&"false"===t.consolelog&&(this.P=!1),void 0!==t.ot&&"true"===t.ot&&(this.Z=!0),void 0!==t.nt&&"true"===t.nt&&(this.$=!0),this.R=t,void 0===t.localvideoid?(this.ht=t.localvideodom,!0===this.P&&console.log(t.token,"[CFE] local use dom directly")):(this.ht