tweb/public/783.949e247466ad3ebe82d6.ch...

1 line
3.5 KiB
Plaintext

{"version":3,"file":"783.949e247466ad3ebe82d6.chunk.js","mappings":"oGAGK,8BAA+BA,iBAAiBC,YAAc,4BAA6BD,iBAAiBC,YAC/GD,iBAAiBC,UAAUC,iBAAmB,CAAC,EAC/CF,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,kBACAC,8BAEKZ,KAAKJ,iBAAiB8B,E,MAE7B1B,KAAKJ,iBAAiB8B,GAAUC,uBAAsBC,GAASrB,EAAME,EAAKmB,I,EAIxEF,EAASG,KAAKpB,MACdA,EAAMqB,YAAYrB,MAExB,OADAT,KAAKJ,iBAAiB8B,GAAUC,uBAAsBC,GAASrB,EAAME,EAAKmB,KACnEF,CACT,EAEAhC,iBAAiBC,UAAUoC,yBAA2B,SAASL,GAC7DM,qBAAqBhC,KAAKJ,iBAAiB8B,WACpC1B,KAAKJ,iBAAiB8B,EAC/B,E","sources":["webpack://tweb/./src/helpers/dom/requestVideoFrameCallbackPolyfill.ts"],"sourcesContent":["// @ts-nocheck\n// https://github.com/ThaUnknown/rvfc-polyfill/blob/main/index.js\n\nif(!('requestVideoFrameCallback' in HTMLVideoElement.prototype) && 'getVideoPlaybackQuality' in HTMLVideoElement.prototype) {\n HTMLVideoElement.prototype._rvfcpolyfillmap = {};\n HTMLVideoElement.prototype.requestVideoFrameCallback = function(callback) {\n const quality = this.getVideoPlaybackQuality();\n const baseline = this.mozPresentedFrames || this.mozPaintedFrames || quality.totalVideoFrames - quality.droppedVideoFrames;\n\n const check = (old, now) => {\n const newquality = this.getVideoPlaybackQuality();\n const presentedFrames = this.mozPresentedFrames || this.mozPaintedFrames || newquality.totalVideoFrames - newquality.droppedVideoFrames;\n if(presentedFrames > baseline) {\n const processingDuration = this.mozFrameDelay || (newquality.totalFrameDelay - quality.totalFrameDelay) || 0;\n const timediff = now - old; // HighRes diff\n callback(now, {\n presentationTime: now + processingDuration * 1000,\n expectedDisplayTime: now + timediff,\n width: this.videoWidth,\n height: this.videoHeight,\n mediaTime: Math.max(0, this.currentTime || 0) + timediff / 1000,\n presentedFrames,\n processingDuration\n });\n delete this._rvfcpolyfillmap[handle];\n } else {\n this._rvfcpolyfillmap[handle] = requestAnimationFrame(newer => check(now, newer));\n }\n }\n\n const handle = Date.now();\n const now = performance.now();\n this._rvfcpolyfillmap[handle] = requestAnimationFrame(newer => check(now, newer));\n return handle; // spec says long, not doube, so can't re-use performance.now\n };\n\n HTMLVideoElement.prototype.cancelVideoFrameCallback = function(handle) {\n cancelAnimationFrame(this._rvfcpolyfillmap[handle]);\n delete this._rvfcpolyfillmap[handle];\n };\n}\n\nexport {};\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":""}