mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-26 08:51:20 -08:00
build all
Refactor utility functions for improved readability and consistency - Updated compatibility.js to use consistent line endings and formatting. - Refactored component.js for better readability and structure, including consistent use of arrow functions and binding. - Simplified dom.js functions with consistent formatting and improved readability. - Enhanced emitter.js with consistent formatting and arrow function usage. - Streamlined error.js for improved readability and consistency. - Refactored file.js to use consistent formatting and improved readability. - Improved format.js functions for better readability and consistency. - Updated index.js to maintain consistent export formatting. - Refactored property.js for improved readability and consistency. - Enhanced subtitle.js with consistent formatting and improved readability. - Refactored time.js for better readability and consistent formatting. fix: update lint script to target only source files for consistency Revert "fix: restore export statements for various plugins and update type definitions for better clarity" This reverts commit b5e969d81ec765cd8a34b06e6ef4f232ef25087f. fix: restore export statements for various plugins and update type definitions for better clarity Refactor type definitions to use interfaces instead of type aliases for better extensibility and clarity across i18n, icons, option, player, quality, setting, subtitle, template, and utils modules.
This commit is contained in:
1 parent
532dd67cfd
commit
35ad9883af
447 files changed
+18248
-17946
No files matched your search
@@ -5,4 +5,4 @@
|
||||
* (c) 2017-2025 Harvey Zack
|
||||
* Released under the MIT License.
|
||||
*/
|
||||
!function(e,t,r,n,o,i,a,u){var c="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{},s="function"==typeof c[n]&&c[n],l=s.i||{},f=s.cache||{},p="undefined"!=typeof module&&"function"==typeof module.require&&module.require.bind(module);function d(t,r){if(!f[t]){if(!e[t]){if(o[t])return o[t];var i="function"==typeof c[n]&&c[n];if(!r&&i)return i(t,!0);if(s)return s(t,!0);if(p&&"string"==typeof t)return p(t);var a=Error("Cannot find module '"+t+"'");throw a.code="MODULE_NOT_FOUND",a}l.resolve=function(r){var n=e[t][1][r];return null!=n?n:r},l.cache={};var u=f[t]=new d.Module(t);e[t][0].call(u.exports,l,u,u.exports,c)}return f[t].exports;function l(e){var t=l.resolve(e);return!1===t?{}:d(t)}}d.isParcelRequire=!0,d.Module=function(e){this.id=e,this.bundle=d,this.require=p,this.exports={}},d.modules=e,d.cache=f,d.parent=s,d.distDir=void 0,d.publicUrl=void 0,d.devServer=void 0,d.i=l,d.register=function(t,r){e[t]=[function(e,t){t.exports=r},{}]},Object.defineProperty(d,"root",{get:function(){return c[n]}}),c[n]=d;for(var y=0;y<t.length;y++)d(t[y]);if(r){var h=d(r);"object"==typeof exports&&"undefined"!=typeof module?module.exports=h:"function"==typeof define&&define.amd&&define(function(){return h})}}({bzF6W:[function(e,t,r,n){var o=e("@parcel/transformer-js/src/esmodule-helpers.js");o.defineInteropFlag(r),o.export(r,"default",function(){return s});var i=e("@swc/helpers/cjs/_async_to_generator.cjs"),a=e("@swc/helpers/cjs/_ts_generator.cjs"),u=e("bundle-text:./style.less"),c=o.interopDefault(u);function s(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.length,r=void 0===t?3:t,n=e.interval,o=void 0===n?100:n,u=e.sampleRate,c=void 0===u?16e3:u,s=e.autoHideTimeout,l=void 0===s?1e4:s,f=e.onAudioChunk,p=void 0===f?function(){return null}:f;return function(e){var t=!1,n=null,u=null,s=null,f=null,d=[],y=null,h=!1,_=null,v=null,b=null,m=e.layers.add({name:"asr",html:""});function w(){m.style.display="none"}function g(e){"string"==typeof e&&(clearTimeout(_),_=setTimeout(w,l),m.style.display="",m.innerHTML=e.split(RegExp("(?<=[、。!?!?\\.])\\s*","u")).map(function(e){return e.trim()}).filter(Boolean).slice(-r).map(function(e){return'<div class="art-asr-line">'.concat(e,"</div>")}).join(""))}var x=function(){var e=new Blob(["\n class RecorderProcessor extends AudioWorkletProcessor {\n process(inputs) {\n const input = inputs[0];\n if (input && input[0]) {\n this.port.postMessage(input[0]);\n }\n return true;\n }\n }\n registerProcessor('recorder-processor', RecorderProcessor);\n "],{type:"application/javascript"});return URL.createObjectURL(e)};function j(){return(j=(0,i._)(function(){return(0,a._)(this,function(e){switch(e.label){case 0:if(n)return[2,n];if("suspended"!==(n=new(window.AudioContext||window.webkitAudioContext)({sampleRate:c})).state)return[3,2];return[4,n.resume()];case 1:e.sent(),e.label=2;case 2:return[2,n]}})})).apply(this,arguments)}function O(){return(O=(0,i._)(function(){return(0,a._)(this,function(t){switch(t.label){case 0:if(!u&&e.video)try{return u=n.createMediaElementSource(e.video),[2,u]}catch(e){console.warn("[artplayerPluginAsr] Direct connection failed:",e)}t.label=1;case 1:if(t.trys.push([1,4,,5]),v)return[3,3];return[4,function(e){return P.apply(this,arguments)}(e.video)];case 2:v=t.sent(),t.label=3;case 3:if(v)return[2,b=n.createMediaStreamSource(v)];return[3,5];case 4:return console.warn("[artplayerPluginAsr] MediaStream fallback failed:",t.sent()),[3,5];case 5:return[2,null]}})})).apply(this,arguments)}function P(){return(P=(0,i._)(function(e){return(0,a._)(this,function(t){try{if(e.captureStream)return[2,e.captureStream()];if(e.mozCaptureStream)return[2,e.mozCaptureStream()];return console.warn("[artplayerPluginAsr] captureStream not supported"),[2,null]}catch(e){return console.warn("[artplayerPluginAsr] Error capturing stream:",e),[2,null]}})})).apply(this,arguments)}function S(){return(S=(0,i._)(function(){var e,r,u;return(0,a._)(this,function(l){switch(l.label){case 0:if(t)return[2];l.label=1;case 1:return l.trys.push([1,6,,8]),[4,function(){return j.apply(this,arguments)}()];case 2:return l.sent(),[4,function(){return O.apply(this,arguments)}()];case 3:if(!(e=l.sent()))throw Error("Could not establish audio source");if(h)return[3,5];return r=x(),[4,n.audioWorklet.addModule(r)];case 4:l.sent(),URL.revokeObjectURL(r),h=!0,l.label=5;case 5:return(f=n.createGain()).gain.value=1,(s=new AudioWorkletNode(n,"recorder-processor")).port.onmessage=function(e){d.push(new Float32Array(e.data))},e.connect(s),e.connect(f),f.connect(n.destination),u=o/1e3*c,y=setInterval((0,i._)(function(){var e,t,r,n;return(0,a._)(this,function(o){switch(o.label){case 0:var i,a,s,l,f;if(0===d.length)return[2];for(e=new Float32Array(0);e.length<u&&d.length;)t=d.shift(),(r=new Float32Array(e.length+t.length)).set(e,0),r.set(t,e.length),e=r;if(e.length<u)return[2];return i=n=function(e){for(var t=e.length,rLine truncated
|
||||
!function(e,t,r,n,o,i,a,u){var c="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{},s="function"==typeof c[n]&&c[n],l=s.i||{},f=s.cache||{},p="undefined"!=typeof module&&"function"==typeof module.require&&module.require.bind(module);function d(t,r){if(!f[t]){if(!e[t]){if(o[t])return o[t];var i="function"==typeof c[n]&&c[n];if(!r&&i)return i(t,!0);if(s)return s(t,!0);if(p&&"string"==typeof t)return p(t);var a=Error("Cannot find module '"+t+"'");throw a.code="MODULE_NOT_FOUND",a}l.resolve=function(r){var n=e[t][1][r];return null!=n?n:r},l.cache={};var u=f[t]=new d.Module(t);e[t][0].call(u.exports,l,u,u.exports,c)}return f[t].exports;function l(e){var t=l.resolve(e);return!1===t?{}:d(t)}}d.isParcelRequire=!0,d.Module=function(e){this.id=e,this.bundle=d,this.require=p,this.exports={}},d.modules=e,d.cache=f,d.parent=s,d.distDir=void 0,d.publicUrl=void 0,d.devServer=void 0,d.i=l,d.register=function(t,r){e[t]=[function(e,t){t.exports=r},{}]},Object.defineProperty(d,"root",{get:function(){return c[n]}}),c[n]=d;for(var y=0;y<t.length;y++)d(t[y]);if(r){var _=d(r);"object"==typeof exports&&"undefined"!=typeof module?module.exports=_:"function"==typeof define&&define.amd&&define(function(){return _})}}({"98QZN":[function(e,t,r,n){var o=e("@parcel/transformer-js/src/esmodule-helpers.js");o.defineInteropFlag(r),o.export(r,"default",function(){return s});var i=e("@swc/helpers/cjs/_async_to_generator.cjs"),a=e("@swc/helpers/cjs/_ts_generator.cjs"),u=e("bundle-text:./style.less"),c=o.interopDefault(u);function s(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.length,r=void 0===t?3:t,n=e.interval,o=void 0===n?100:n,u=e.sampleRate,c=void 0===u?16e3:u,s=e.autoHideTimeout,l=void 0===s?1e4:s,f=e.onAudioChunk,p=void 0===f?function(){return null}:f;return function(e){var t=!1,n=null,u=null,s=null,f=null,d=[],y=null,_=!1,h=null,v=null,b=null,m=e.layers.add({name:"asr",html:""});function w(){m.style.display="none"}function g(e){"string"==typeof e&&(clearTimeout(h),h=setTimeout(w,l),m.style.display="",m.innerHTML=e.split(RegExp("(?<=[、。!?!?.])\\s*","u")).map(function(e){return e.trim()}).filter(Boolean).slice(-r).map(function(e){return'<div class="art-asr-line">'.concat(e,"</div>")}).join(""))}var x=function(){var e=new Blob(["\n class RecorderProcessor extends AudioWorkletProcessor {\n process(inputs) {\n const input = inputs[0];\n if (input && input[0]) {\n this.port.postMessage(input[0]);\n }\n return true;\n }\n }\n registerProcessor('recorder-processor', RecorderProcessor);\n "],{type:"application/javascript"});return URL.createObjectURL(e)};function j(){return(0,i._)(function(){return(0,a._)(this,function(e){return t&&(t=!1,clearInterval(y),y=null,s&&(s.disconnect(),s.port.onmessage=null,s=null),f&&(f.disconnect(),f=null),d=[]),[2]})})()}function O(){return(0,i._)(function(){return(0,a._)(this,function(e){switch(e.label){case 0:return[4,j()];case 1:if(e.sent(),b&&(b.disconnect(),b=null),u&&(u.disconnect(),u=null),v&&(v.getTracks().forEach(function(e){return e.stop()}),v=null),!n)return[3,3];return[4,n.close()];case 2:e.sent(),n=null,e.label=3;case 3:return _=!1,[2]}})})()}return e.on("video:volumechange",function(){f&&(f.gain.value=e.volume)}),e.on("play",function(){return(0,i._)(function(){var r,l,h;return(0,a._)(this,function(m){switch(m.label){case 0:if(t)return[2];m.label=1;case 1:return m.trys.push([1,6,,8]),[4,(0,i._)(function(){return(0,a._)(this,function(e){switch(e.label){case 0:if(n)return[2,n];if("suspended"!==(n=new(window.AudioContext||window.webkitAudioContext)({sampleRate:c})).state)return[3,2];return[4,n.resume()];case 1:e.sent(),e.label=2;case 2:return[2,n]}})})()];case 2:return m.sent(),[4,(0,i._)(function(){return(0,a._)(this,function(t){switch(t.label){case 0:if(!u&&e.video)try{return u=n.createMediaElementSource(e.video),[2,u]}catch(e){console.warn("[artplayerPluginAsr] Direct connection failed:",e)}t.label=1;case 1:var r;if(t.trys.push([1,4,,5]),v)return[3,3];return[4,(r=e.video,(0,i._)(function(){return(0,a._)(this,function(e){try{if(r.captureStream)return[2,r.captureStream()];if(r.mozCaptureStream)return[2,r.mozCaptureStream()];return console.warn("[artplayerPluginAsr] captureStream not supported"),[2,null]}catch(e){return console.warn("[artplayerPluginAsr] Error capturing stream:",e),[2,null]}})})())];case 2:v=t.sent(),t.label=3;case 3:if(v)return[2,b=n.createMediaStreamSource(v)];return[3,5];case 4:return console.warn("[artplayerPluginAsr] MediaStream fallback failed:",t.sent()),[3,5];case 5:return[2,null]}})})()];case 3:if(!(r=m.sent()))throw Error("Could not establish audio source");if(_)return[3,5];return l=x(),[4,n.audioWorklet.addModule(l)];case 4:m.sent(),URL.revokeObjectURL(l),_=!0,m.label=5;case 5:return(f=n.createGain()).gain.value=1,(s=new AudioWorkletNode(n,"recorder-processor")).port.onmessage=function(e){d.push(new Float32Array(e.data))},r.connect(s),r.connect(f),f.conLine truncated
|
||||
Reference in new issue
Block a user