diff --git a/package.json b/package.json index 4a67109..d4ee066 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { - "name": "poros-demo-client", + "name": "blive-coyote-demo-client", "private": true, - "version": "0.0.0", + "version": "0.0.1", "scripts": { "dev": "vite --port 8888 --host 0.0.0.0 ", "build": "vue-tsc --noEmit && vite build", diff --git a/src/assets/danmaku-websocket.min.js b/src/assets/danmaku-websocket.min.js index ae0b44f..e7eb10d 100644 --- a/src/assets/danmaku-websocket.min.js +++ b/src/assets/danmaku-websocket.min.js @@ -1,8 +1,9 @@ /*! * Bilibili Player Danmaku Websocket Component v1.4.3 (32) -* +* * Copyright 2016 - 2020 Bilibili, Inc. * Released in Fri Nov 27 2020 15:45:21 GMT+0800 (China Standard Time) */ !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.DanmakuWebSocket=t():e.DanmakuWebSocket=t()}("undefined"!=typeof self?self:this,function(){return function(e){function t(i){if(n[i])return n[i].exports;var o=n[i]={i:i,l:!1,exports:{}};return e[i].call(o.exports,o,o.exports,t),o.l=!0,o.exports}var n={};return t.m=e,t.c=n,t.d=function(e,n,i){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:i})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=1)}([function(e,t,n){"use strict";var i={WS_OP_HEARTBEAT:2,WS_OP_HEARTBEAT_REPLY:3,WS_OP_MESSAGE:5,WS_OP_USER_AUTHENTICATION:7,WS_OP_CONNECT_SUCCESS:8,WS_PACKAGE_HEADER_TOTAL_LENGTH:16,WS_PACKAGE_OFFSET:0,WS_HEADER_OFFSET:4,WS_VERSION_OFFSET:6,WS_OPERATION_OFFSET:8,WS_SEQUENCE_OFFSET:12,WS_BODY_PROTOCOL_VERSION_NORMAL:0,WS_BODY_PROTOCOL_VERSION_DEFLATE:2,WS_HEADER_DEFAULT_VERSION:1,WS_HEADER_DEFAULT_OPERATION:1,WS_HEADER_DEFAULT_SEQUENCE:1,WS_AUTH_OK:0,WS_AUTH_TOKEN_ERROR:-101};t.a=i},function(e,t,n){var i=n(2).default;e.exports=i},function(e,t,n){"use strict";function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var o=n(3),r=function(){function e(e,t){for(var n=0;n0?this.options.urlList[0]:this.options.url)}}return e.prototype.initialize=function(e){var t=this,n="MozWebSocket"in window?window.MozWebSocket:window.WebSocket,i=this.options;try{this.ws=new n(e),this.ws.binaryType="arraybuffer",this.ws.onopen=this.onOpen.bind(this),this.ws.onmessage=this.onMessage.bind(this),this.ws.onclose=this.onClose.bind(this),this.ws.onerror=this.onError.bind(this),a.a.callFunction(this.callbackQueueList.onInitializedQueue),this.callbackQueueList.onInitializedQueue=[];var o=this.state.connectTimeoutTimes>=3?i.retryconnectTimeout:i.connectTimeout;this.CONNECT_TIMEOUT=setTimeout(function(){t.state.connectTimeoutTimes+=1,console.error("connect timeout ",t.state.connectTimeoutTimes),t.ws.close()},o)}catch(e){"function"==typeof i.fallback&&i.fallback()}return this},e.prototype.onOpen=function(){return a.a.callFunction(this.callbackQueueList.onOpenQueue),this.state.connectTimeoutTimes=0,this.CONNECT_TIMEOUT&&clearTimeout(this.CONNECT_TIMEOUT),this.userAuthentication(),this},e.prototype.userAuthentication=function(){var e=this,t=this.options,n={uid:parseInt(t.uid,10),roomid:parseInt(t.rid,10),protover:parseInt(t.protover,10)||o.a.WS_BODY_PROTOCOL_VERSION_NORMAL},i="";t.aid&&(n.aid=parseInt(t.aid,10)),t.from>0&&(n.from=parseInt(t.from,10)||7);for(var r=0;re.options.retryThreadCount?setTimeout(function(){e.initialize(e.options.url)},1e3*e.options.retryRoundInterval):0!==t&&e.state.index>t-1?(e.state.index=0,e.state.listConnectFinishedCount+=1,1===e.state.listConnectFinishedCount&&a.a.callFunction(e.callbackQueueList.onListConnectErrorQueue),setTimeout(function(){e.initialize(e.options.urlList[e.state.index])},1e3*e.options.retryRoundInterval)):e.initialize(e.options.urlList[e.state.index])},1e3*this.options.retryInterval):(console.error("Danmaku Websocket Retry Failed."),a.a.callFunction(this.callbackQueueList.onRetryFallbackQueue)),this):this},e.prototype.onError=function(e){return console.error("Danmaku Websocket On Error.",e),a.a.callFunction(this.callbackQueueList.onErrorQueue,e),this},e.prototype.destroy=function(){this.HEART_BEAT_INTERVAL&&clearTimeout(this.HEART_BEAT_INTERVAL),this.CONNECT_TIMEOUT&&clearTimeout(this.CONNECT_TIMEOUT),this.options.retry=!1,this.ws&&this.ws.close(),this.ws=null},e.prototype.convertToArrayBuffer=function(e,t){this.encoder||(this.encoder=a.a.getEncoder());var n=new ArrayBuffer(o.a.WS_PACKAGE_HEADER_TOTAL_LENGTH),i=new DataView(n,o.a.WS_PACKAGE_OFFSET),r=this.encoder.encode(e);return i.setInt32(o.a.WS_PACKAGE_OFFSET,o.a.WS_PACKAGE_HEADER_TOTAL_LENGTH+r.byteLength),this.wsBinaryHeaderList[2].value=t,this.wsBinaryHeaderList.forEach(function(e){4===e.bytes?i.setInt32(e.offset,e.value):2===e.bytes&&i.setInt16(e.offset,e.value)}),a.a.mergeArrayBuffer(n,r)},e.prototype.convertToObject=function(e){var t=new DataView(e),n={body:[]};if(n.packetLen=t.getInt32(o.a.WS_PACKAGE_OFFSET),this.wsBinaryHeaderList.forEach(function(e){4===e.bytes?n[e.key]=t.getInt32(e.offset):2===e.bytes&&(n[e.key]=t.getInt16(e.offset))}),n.packetLen1?t-1:0),i=1;i>>6:(t[a++]=n<65536?224|n>>>12:(t[a++]=240|n>>>18,128|n>>>12&63),128|n>>>6&63),128|63&n);return t},n.buf2binstring=function(e){return i(e,e.length)},n.binstring2buf=function(e){for(var t=new o.Buf8(e.length),n=0,i=t.length;n>10&1023,56320|1023&r)}return i(c,o)},n.utf8border=function(e,t){var n;for((t=t||e.length)>e.length&&(t=e.length),n=t-1;0<=n&&128==(192&e[n]);)n--;return n<0?t:0===n?t:n+s[e[n]]>t?n:t}},{"./common":1}],3:[function(e,t,n){"use strict";t.exports=function(e,t,n,i){for(var o=65535&e|0,r=e>>>16&65535|0,a=0;0!==n;){for(n-=a=2e3>>1:e>>>1;t[n]=e}return t}();t.exports=function(e,t,n,o){var r=i,a=o+n;e^=-1;for(var s=o;s>>8^r[255&(e^t[s])];return-1^e}},{}],6:[function(e,t,n){"use strict";t.exports=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}},{}],7:[function(e,t,n){"use strict";t.exports=function(e,t){var n,i,o,r,a,s,u,c,l,f,h,d,b,_,p,y,m,w,k,E,g,v,T,A,S;n=e.state,i=e.next_in,A=e.input,o=i+(e.avail_in-5),r=e.next_out,S=e.output,a=r-(t-e.avail_out),s=r+(e.avail_out-257),u=n.dmax,c=n.wsize,l=n.whave,f=n.wnext,h=n.window,d=n.hold,b=n.bits,_=n.lencode,p=n.distcode,y=(1<>>=k=w>>>24,b-=k,0==(k=w>>>16&255))S[r++]=65535&w;else{if(!(16&k)){if(0==(64&k)){w=_[(65535&w)+(d&(1<>>=k,b-=k),b<15&&(d+=A[i++]<>>=k=w>>>24,b-=k,!(16&(k=w>>>16&255))){if(0==(64&k)){w=p[(65535&w)+(d&(1<>>=k,b-=k,(k=r-a)>3,d&=(1<<(b-=E<<3))-1,e.next_in=i,e.next_out=r,e.avail_in=i>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24)}function o(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new d.Buf16(320),this.work=new d.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function r(e){var t;return e&&e.state?(t=e.state,e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=1&t.wrap),t.mode=g,t.last=0,t.havedict=0,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new d.Buf32(v),t.distcode=t.distdyn=new d.Buf32(T),t.sane=1,t.back=-1,k):E}function a(e){var t;return e&&e.state?((t=e.state).wsize=0,t.whave=0,t.wnext=0,r(e)):E}function s(e,t){var n,i;return e&&e.state?(i=e.state,t<0?(n=0,t=-t):(n=1+(t>>4),t<48&&(t&=15)),t&&(t<8||15=r.wsize?(d.arraySet(r.window,t,n-r.wsize,r.wsize,0),r.wnext=0,r.whave=r.wsize):(i<(o=r.wsize-r.wnext)&&(o=i),d.arraySet(r.window,t,n-i,o,r.wnext),(i-=o)?(d.arraySet(r.window,t,n-i,i,0),r.wnext=i,r.whave=r.wsize):(r.wnext+=o,r.wnext===r.wsize&&(r.wnext=0),r.whave>>8&255,n.check=_(n.check,z,2,0),v=h=0,n.mode=2;break}if(n.flags=0,n.head&&(n.head.done=!1),!(1&n.wrap)||(((255&h)<<8)+(h>>8))%31){e.msg="incorrect header check",n.mode=30;break}if(8!=(15&h)){e.msg="unknown compression method",n.mode=30;break}if(v-=4,F=8+(15&(h>>>=4)),0===n.wbits)n.wbits=F;else if(F>n.wbits){e.msg="invalid window size",n.mode=30;break}n.dmax=1<>8&1),512&n.flags&&(z[0]=255&h,z[1]=h>>>8&255,n.check=_(n.check,z,2,0)),v=h=0,n.mode=3;case 3:for(;v<32;){if(0===u)break e;u--,h+=o[a++]<>>8&255,z[2]=h>>>16&255,z[3]=h>>>24&255,n.check=_(n.check,z,4,0)),v=h=0,n.mode=4;case 4:for(;v<16;){if(0===u)break e;u--,h+=o[a++]<>8),512&n.flags&&(z[0]=255&h,z[1]=h>>>8&255,n.check=_(n.check,z,2,0)),v=h=0,n.mode=5;case 5:if(1024&n.flags){for(;v<16;){if(0===u)break e;u--,h+=o[a++]<>>8&255,n.check=_(n.check,z,2,0)),v=h=0}else n.head&&(n.head.extra=null);n.mode=6;case 6:if(1024&n.flags&&(u<(S=n.length)&&(S=u),S&&(n.head&&(F=n.head.extra_len-n.length,n.head.extra||(n.head.extra=new Array(n.head.extra_len)),d.arraySet(n.head.extra,o,a,S,F)),512&n.flags&&(n.check=_(n.check,o,S,a)),u-=S,a+=S,n.length-=S),n.length))break e;n.length=0,n.mode=7;case 7:if(2048&n.flags){if(0===u)break e;for(S=0;F=o[a+S++],n.head&&F&&n.length<65536&&(n.head.name+=String.fromCharCode(F)),F&&S>9&1,n.head.done=!0),e.adler=n.check=0,n.mode=12;break;case 10:for(;v<32;){if(0===u)break e;u--,h+=o[a++]<>>=7&v,v-=7&v,n.mode=27;break}for(;v<3;){if(0===u)break e;u--,h+=o[a++]<>>=1)){case 0:n.mode=14;break;case 1:if(c(n),n.mode=20,6!==t)break;h>>>=2,v-=2;break e;case 2:n.mode=17;break;case 3:e.msg="invalid block type",n.mode=30}h>>>=2,v-=2;break;case 14:for(h>>>=7&v,v-=7&v;v<32;){if(0===u)break e;u--,h+=o[a++]<>>16^65535)){e.msg="invalid stored block lengths",n.mode=30;break}if(n.length=65535&h,v=h=0,n.mode=15,6===t)break e;case 15:n.mode=16;case 16:if(S=n.length){if(u>>=5,v-=5,n.ndist=1+(31&h),h>>>=5,v-=5,n.ncode=4+(15&h),h>>>=4,v-=4,286>>=3,v-=3}for(;n.have<19;)n.lens[P[n.have++]]=0;if(n.lencode=n.lendyn,n.lenbits=7,D={bits:n.lenbits},H=y(0,n.lens,0,19,n.lencode,0,n.work,D),n.lenbits=D.bits,H){e.msg="invalid code lengths set",n.mode=30;break}n.have=0,n.mode=19;case 19:for(;n.have>>16&255,I=65535&W,!((C=W>>>24)<=v);){if(0===u)break e;u--,h+=o[a++]<>>=C,v-=C,n.lens[n.have++]=I;else{if(16===I){for(U=C+2;v>>=C,v-=C,0===n.have){e.msg="invalid bit length repeat",n.mode=30;break}F=n.lens[n.have-1],S=3+(3&h),h>>>=2,v-=2}else if(17===I){for(U=C+3;v>>=C)),h>>>=3,v-=3}else{for(U=C+7;v>>=C)),h>>>=7,v-=7}if(n.have+S>n.nlen+n.ndist){e.msg="invalid bit length repeat",n.mode=30;break}for(;S--;)n.lens[n.have++]=F}}if(30===n.mode)break;if(0===n.lens[256]){e.msg="invalid code -- missing end-of-block",n.mode=30;break}if(n.lenbits=9,D={bits:n.lenbits},H=y(m,n.lens,0,n.nlen,n.lencode,0,n.work,D),n.lenbits=D.bits,H){e.msg="invalid literal/lengths set",n.mode=30;break}if(n.distbits=6,n.distcode=n.distdyn,D={bits:n.distbits},H=y(w,n.lens,n.nlen,n.ndist,n.distcode,0,n.work,D),n.distbits=D.bits,H){e.msg="invalid distances set",n.mode=30;break}if(n.mode=20,6===t)break e;case 20:n.mode=21;case 21:if(6<=u&&258<=f){e.next_out=s,e.avail_out=f,e.next_in=a,e.avail_in=u,n.hold=h,n.bits=v,p(e,A),s=e.next_out,r=e.output,f=e.avail_out,a=e.next_in,o=e.input,u=e.avail_in,h=n.hold,v=n.bits,12===n.mode&&(n.back=-1);break}for(n.back=0;x=(W=n.lencode[h&(1<>>16&255,I=65535&W,!((C=W>>>24)<=v);){if(0===u)break e;u--,h+=o[a++]<>L)])>>>16&255,I=65535&W,!(L+(C=W>>>24)<=v);){if(0===u)break e;u--,h+=o[a++]<>>=L,v-=L,n.back+=L}if(h>>>=C,v-=C,n.back+=C,n.length=I,0===x){n.mode=26;break}if(32&x){n.back=-1,n.mode=12;break}if(64&x){e.msg="invalid literal/length code",n.mode=30;break}n.extra=15&x,n.mode=22;case 22:if(n.extra){for(U=n.extra;v>>=n.extra,v-=n.extra,n.back+=n.extra}n.was=n.length,n.mode=23;case 23:for(;x=(W=n.distcode[h&(1<>>16&255,I=65535&W,!((C=W>>>24)<=v);){if(0===u)break e;u--,h+=o[a++]<>L)])>>>16&255,I=65535&W,!(L+(C=W>>>24)<=v);){if(0===u)break e;u--,h+=o[a++]<>>=L,v-=L,n.back+=L}if(h>>>=C,v-=C,n.back+=C,64&x){e.msg="invalid distance code",n.mode=30;break}n.offset=I,n.extra=15&x,n.mode=24;case 24:if(n.extra){for(U=n.extra;v>>=n.extra,v-=n.extra,n.back+=n.extra}if(n.offset>n.dmax){e.msg="invalid distance too far back",n.mode=30;break}n.mode=25;case 25:if(0===f)break e;if(S=A-f,n.offset>S){if((S=n.offset-S)>n.whave&&n.sane){e.msg="invalid distance too far back",n.mode=30;break}O=S>n.wnext?(S-=n.wnext,n.wsize-S):n.wnext-S,S>n.length&&(S=n.length),R=n.window}else R=r,O=s-n.offset,S=n.length;for(fm?(k=D[U+f[T]],N[B+f[T]]):(k=96,0),d=1<>C)+(b-=d)]=w<<24|k<<16|E|0,0!==b;);for(d=1<>=1;if(0!==d?(L&=d-1,L+=d):L=0,T++,0==--F[v]){if(v===S)break;v=t[n+f[T]]}if(O