tweb/public/783.f11cb0c1a31abe1156bd.ch...

1 line
3.6 KiB
Plaintext

{"version":3,"file":"783.f11cb0c1a31abe1156bd.chunk.js","mappings":"oGAGK,8BAA+BA,iBAAiBC,YAAc,4BAA6BD,iBAAiBC,YAC/GD,iBAAiBC,UAAUC,iBAAmB,GAC9CF,iBAAiBC,UAAUE,0BAA4B,SAASC,GAC9D,MAAMC,EAAUC,KAAKC,0BACfC,EAAWF,KAAKG,oBAAsBH,KAAKI,kBAAoBL,EAAQM,iBAAmBN,EAAQO,mBAElGC,EAAQ,CAACC,EAAKC,KAClB,MAAMC,EAAaV,KAAKC,0BAClBU,EAAkBX,KAAKG,oBAAsBH,KAAKI,kBAAoBM,EAAWL,iBAAmBK,EAAWJ,mBACrH,GAAGK,EAAkBT,EAAU,CAC7B,MAAMU,EAAqBZ,KAAKa,eAAkBH,EAAWI,gBAAkBf,EAAQe,iBAAoB,EACrGC,EAAWN,EAAMD,EACvBV,EAASW,EAAK,CACZO,iBAAkBP,EAA2B,IAArBG,EACxBK,oBAAqBR,EAAMM,EAC3BG,MAAOlB,KAAKmB,WACZC,OAAQpB,KAAKqB,YACbC,UAAWC,KAAKC,IAAI,EAAGxB,KAAKyB,aAAe,GAAKV,EAAW,IAC3DJ,gBAAAA,EACAC,mBAAAA,WAEKZ,KAAKJ,iBAAiB8B,QAE7B1B,KAAKJ,iBAAiB8B,GAAUC,uBAAsBC,GAASrB,EAAME,EAAKmB,MAIxEF,EAASG,KAAKpB,MACdA,EAAMqB,YAAYrB,MAExB,OADAT,KAAKJ,iBAAiB8B,GAAUC,uBAAsBC,GAASrB,EAAME,EAAKmB,KACnEF,GAGThC,iBAAiBC,UAAUoC,yBAA2B,SAASL,GAC7DM,qBAAqBhC,KAAKJ,iBAAiB8B,WACpC1B,KAAKJ,iBAAiB8B","sources":["webpack://tweb/./src/helpers/dom/requestVideoFrameCallbackPolyfill.ts"],"sourcesContent":["// @ts-nocheck\r\n// https://github.com/ThaUnknown/rvfc-polyfill/blob/main/index.js\r\n\r\nif(!('requestVideoFrameCallback' in HTMLVideoElement.prototype) && 'getVideoPlaybackQuality' in HTMLVideoElement.prototype) {\r\n HTMLVideoElement.prototype._rvfcpolyfillmap = {};\r\n HTMLVideoElement.prototype.requestVideoFrameCallback = function(callback) {\r\n const quality = this.getVideoPlaybackQuality();\r\n const baseline = this.mozPresentedFrames || this.mozPaintedFrames || quality.totalVideoFrames - quality.droppedVideoFrames;\r\n\r\n const check = (old, now) => {\r\n const newquality = this.getVideoPlaybackQuality();\r\n const presentedFrames = this.mozPresentedFrames || this.mozPaintedFrames || newquality.totalVideoFrames - newquality.droppedVideoFrames;\r\n if(presentedFrames > baseline) {\r\n const processingDuration = this.mozFrameDelay || (newquality.totalFrameDelay - quality.totalFrameDelay) || 0;\r\n const timediff = now - old; // HighRes diff\r\n callback(now, {\r\n presentationTime: now + processingDuration * 1000,\r\n expectedDisplayTime: now + timediff,\r\n width: this.videoWidth,\r\n height: this.videoHeight,\r\n mediaTime: Math.max(0, this.currentTime || 0) + timediff / 1000,\r\n presentedFrames,\r\n processingDuration\r\n });\r\n delete this._rvfcpolyfillmap[handle];\r\n } else {\r\n this._rvfcpolyfillmap[handle] = requestAnimationFrame(newer => check(now, newer));\r\n }\r\n }\r\n\r\n const handle = Date.now();\r\n const now = performance.now();\r\n this._rvfcpolyfillmap[handle] = requestAnimationFrame(newer => check(now, newer));\r\n return handle; // spec says long, not doube, so can't re-use performance.now\r\n };\r\n\r\n HTMLVideoElement.prototype.cancelVideoFrameCallback = function(handle) {\r\n cancelAnimationFrame(this._rvfcpolyfillmap[handle]);\r\n delete this._rvfcpolyfillmap[handle];\r\n };\r\n}\r\n\r\nexport {};\r\n"],"names":["HTMLVideoElement","prototype","_rvfcpolyfillmap","requestVideoFrameCallback","callback","quality","this","getVideoPlaybackQuality","baseline","mozPresentedFrames","mozPaintedFrames","totalVideoFrames","droppedVideoFrames","check","old","now","newquality","presentedFrames","processingDuration","mozFrameDelay","totalFrameDelay","timediff","presentationTime","expectedDisplayTime","width","videoWidth","height","videoHeight","mediaTime","Math","max","currentTime","handle","requestAnimationFrame","newer","Date","performance","cancelVideoFrameCallback","cancelAnimationFrame"],"sourceRoot":""}