filesbox/web/dist/design/designstatic/chatroom/video/flv.min1.js

3 lines
169 KiB
JavaScript
Raw Normal View History

2024-07-26 06:10:54 +00:00
(function(fe){if(typeof exports=="object"&&typeof module!="undefined")module.exports=fe();else if(typeof define=="function"&&define.amd)define([],fe);else{var R;R=typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:this,R.flvjs=fe()}})(function(){var fe;return function R(P,T,k){function C(n,e){if(!T[n]){if(!P[n]){var t=typeof require=="function"&&require;if(!e&&t)return t(n,!0);if(I)return I(n,!0);var r=new Error("Cannot find module '"+n+"'");throw r.code="MODULE_NOT_FOUND",r}var s=T[n]={exports:{}};P[n][0].call(s.exports,function(d){var y=P[n][1][d];return C(y||d)},s,s.exports,R,P,T,k)}return T[n].exports}for(var I=typeof require=="function"&&require,a=0;a<k.length;a++)C(k[a]);return C}({1:[function(R,P,T){(function(k,C){(function(I,a){typeof T=="object"&&P!==void 0?P.exports=a():typeof fe=="function"&&fe.amd?fe(a):I.ES6Promise=a()})(this,function(){"use strict";function I(O){var D=typeof O;return O!==null&&(D==="object"||D==="function")}function a(O){return typeof O=="function"}function n(O){Q=O}function e(O){Z=O}function t(){return H!==void 0?function(){H(s)}:r()}function r(){var O=setTimeout;return function(){return O(s,1)}}function s(){for(var O=0;O<V;O+=2)(0,ne[O])(ne[O+1]),ne[O]=void 0,ne[O+1]=void 0;V=0}function d(O,D){var x=this,N=new this.constructor(l);N[le]===void 0&&M(N);var j=x._state;if(j){var q=arguments[j-1];Z(function(){return v(j,N,q,x._result)})}else S(x,N,O,D);return N}function y(O){var D=this;if(O&&typeof O=="object"&&O.constructor===D)return O;var x=new D(l);return E(x,O),x}function l(){}function c(){return new TypeError("You cannot resolve a promise with itself")}function p(){return new TypeError("A promises callback cannot return that same promise.")}function f(O){try{return O.then}catch(D){return oe.error=D,oe}}function i(O,D,x,N){try{O.call(D,x,N)}catch(j){return j}}function m(O,D,x){Z(function(N){var j=!1,q=i(x,D,function(J){j||(j=!0,D!==J?E(N,J):b(N,J))},function(J){j||(j=!0,L(N,J))},"Settle: "+(N._label||" unknown promise"));!j&&q&&(j=!0,L(N,q))},O)}function o(O,D){D._state===he?b(O,D._result):D._state===ae?L(O,D._result):S(D,void 0,function(x){return E(O,x)},function(x){return L(O,x)})}function u(O,D,x){D.constructor===O.constructor&&x===d&&D.constructor.resolve===y?o(O,D):x===oe?(L(O,oe.error),oe.error=null):x===void 0?b(O,D):a(x)?m(O,D,x):b(O,D)}function E(O,D){O===D?L(O,c()):I(D)?u(O,D,f(D)):b(O,D)}function g(O){O._onerror&&O._onerror(O._result),_(O)}function b(O,D){O._state===se&&(O._result=D,O._state=he,O._subscribers.length!==0&&Z(_,O))}function L(O,D){O._state===se&&(O._state=ae,O._result=D,Z(g,O))}function S(O,D,x,N){var j=O._subscribers,q=j.length;O._onerror=null,j[q]=D,j[q+he]=x,j[q+ae]=N,q===0&&O._state&&Z(_,O)}function _(O){var D=O._subscribers,x=O._state;if(D.length!==0){for(var N=void 0,j=void 0,q=O._result,J=0;J<D.length;J+=3)N=D[J],j=D[J+x],N?v(x,N,j,q):j(q);O._subscribers.length=0}}function h(O,D){try{return O(D)}catch(x){return oe.error=x,oe}}function v(O,D,x,N){var j=a(x),q=void 0,J=void 0,_e=void 0,pe=void 0;if(j){if(q=h(x,N),q===oe?(pe=!0,J=q.error,q.error=null):_e=!0,D===q)return void L(D,p())}else q=N,_e=!0;D._state!==se||(j&&_e?E(D,q):pe?L(D,J):O===he?b(D,q):O===ae&&L(D,q))}function A(O,D){try{D(function(x){E(O,x)},function(x){L(O,x)})}catch(x){L(O,x)}}function w(){return ce++}function M(O){O[le]=ce++,O._state=void 0,O._result=void 0,O._subscribers=[]}function B(){return new Error("Array Methods must be provided an Array")}function G(O){return new me(this,O).promise}function U(O){var D=this;return new D(Y(O)?function(x,N){for(var j=O.length,q=0;q<j;q++)D.resolve(O[q]).then(x,N)}:function(x,N){return N(new TypeError("You must pass an array to race."))})}function K(O){var D=this,x=new D(l);return L(x,O),x}function z(){throw new TypeError("You must pass a resolver function as the first argument to the promise constructor")}function W(){throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.")}function F(){var O=void 0;if(C!==void 0)O=C;else i
dts: `+(ee+te)+" ms, expected: "+(ee+Math.round(L))+" ms, delta: "+Math.round(le)+" ms, generate: "+se+" frames");var ae=s.default.getSilentFrame(this._audioMeta.originalCodec,this._audioMeta.channelCount);ae==null&&(n.default.w(this.TAG,"Unable to generate silent frame for "+this._audioMeta.originalCodec+" with "+this._audioMeta.channelCount+" channels, repeat last frame"),ae=ue),$=[];for(var oe=0;oe<se;oe++){var ce=Math.round(he);if($.length>0){var me=$[$.length-1];me.duration=ce-me.dts}var ie={dts:ce,pts:ce,cts:0,unit:ae,size:ae.byteLength,duration:0,originalDts:re,flags:{isLeading:0,dependsOn:1,isDependedOn:0,hasRedundancy:0}};$.push(ie),w+=ie.size,he+=L}var O=$[$.length-1];O.duration=ee+te-O.dts,te=Math.round(L)}H.push({dts:ee,pts:ee,cts:0,unit:Z.unit,size:Z.unit.byteLength,duration:te,originalDts:re,flags:{isLeading:0,dependsOn:1,isDependedOn:0,hasRedundancy:0}}),ne&&H.push.apply(H,$)}S?A=new Uint8Array(w):(A=new Uint8Array(w),A[0]=w>>>24&255,A[1]=w>>>16&255,A[2]=w>>>8&255,A[3]=255&w,A.set(t.default.types.mdat,4));for(var D=0;D<H.length;D++){var x=H[D].unit;A.set(x,v),v+=x.byteLength}var N=H[H.length-1];b=N.dts+N.duration,this._audioNextDts=b;var j=new l.MediaSegmentInfo;j.beginDts=g,j.endDts=b,j.beginPts=g,j.endPts=b,j.originalBeginDts=H[0].originalDts,j.originalEndDts=N.originalDts+N.duration,j.firstSample=new l.SampleInfo(H[0].dts,H[0].pts,H[0].duration,H[0].originalDts,!1),j.lastSample=new l.SampleInfo(N.dts,N.pts,N.duration,N.originalDts,!1),this._isLive||this._audioSegmentInfoList.append(j),o.samples=H,o.sequenceNumber++;var q=null;q=S?new Uint8Array:t.default.moof(o,g),o.samples=[],o.length=0;var J={type:"audio",data:this._mergeBoxes(q,A).buffer,sampleCount:H.length,info:j};S&&_&&(J.timestampOffset=g),this._onMediaSegment("audio",J)}}}},{key:"_remuxVideo",value:function(i,m){if(this._videoMeta!=null){var o=i,u=o.samples,E=void 0,g=-1,b=-1,L=-1,S=-1;if(u&&u.length!==0&&(u.length!==1||m)){var _=8,h=null,v=8+i.length,A=null;if(u.length>1&&(A=u.pop(),v-=A.length),this._videoStashedLastSample!=null){var w=this._videoStashedLastSample;this._videoStashedLastSample=null,u.unshift(w),v+=w.length}A!=null&&(this._videoStashedLastSample=A);var M=u[0].dts-this._dtsBase;if(this._videoNextDts)E=M-this._videoNextDts;else if(this._videoSegmentInfoList.isEmpty())E=0;else{var B=this._videoSegmentInfoList.getLastSampleBefore(M);if(B!=null){var G=M-(B.originalDts+B.duration);G<=3&&(G=0);var U=B.dts+B.duration+G;E=M-U}else E=0}for(var K=new l.MediaSegmentInfo,z=[],W=0;W<u.length;W++){var F=u[W],X=F.dts-this._dtsBase,Y=F.isKeyframe,V=X-E,H=F.cts,Q=V+H;g===-1&&(g=V,L=Q);var Z=0;if(W!==u.length-1)Z=u[W+1].dts-this._dtsBase-E-V;else if(A!=null){var ue=A.dts-this._dtsBase-E;Z=ue-V}else Z=z.length>=1?z[z.length-1].duration:Math.floor(this._videoMeta.refSampleDuration);if(Y){var re=new l.SampleInfo(V,Q,Z,F.dts,!0);re.fileposition=F.fileposition,K.appendSyncPoint(re)}z.push({dts:V,pts:Q,cts:H,units:F.units,size:F.length,isKeyframe:Y,duration:Z,originalDts:X,flags:{isLeading:0,dependsOn:Y?2:1,isDependedOn:Y?1:0,hasRedundancy:0,isNonSync:Y?0:1}})}h=new Uint8Array(v),h[0]=v>>>24&255,h[1]=v>>>16&255,h[2]=v>>>8&255,h[3]=255&v,h.set(t.default.types.mdat,4);for(var ee=0;ee<z.length;ee++)for(var te=z[ee].units;te.length;){var de=te.shift(),ne=de.data;h.set(ne,_),_+=ne.byteLength}var $=z[z.length-1];if(b=$.dts+$.duration,S=$.pts+$.duration,this._videoNextDts=b,K.beginDts=g,K.endDts=b,K.beginPts=L,K.endPts=S,K.originalBeginDts=z[0].originalDts,K.originalEndDts=$.originalDts+$.duration,K.firstSample=new l.SampleInfo(z[0].dts,z[0].pts,z[0].duration,z[0].originalDts,z[0].isKeyframe),K.lastSample=new l.SampleInfo($.dts,$.pts,$.duration,$.originalDts,$.isKeyframe),this._isLive||this._videoSegmentInfoList.append(K),o.samples=z,o.sequenceNumber++,this._forceFirstIDR){var le=z[0].flags;le.dependsOn=2,le.isNonSync=0}var se=t.default.moof(o,g);o.samples=[],o.length=0,this._onMediaSegment("video",{type:"video",data:this._mergeBoxes(se,h).buffer,sampleCount:z.length,info:K})}}}},{key:"_mergeBoxes",value:function(i,m){var o=new Uint8Array(i.byteLength+m.byteL