mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-21 12:41:20 -08:00
Refactor code structure for improved readability and maintainability
Remove debugging border from the websr plugin's styling Enhance canvas sizing logic in artplayer-plugin-websr - Updated canvas positioning to center it within the player. - Introduced a new function to calculate canvas size based on the video aspect ratio. - Adjusted canvas dimensions during initialization and on resize events to maintain aspect ratio. - Ensured canvas styles are updated to reflect the calculated dimensions. feat: add comparison mode to artplayer-plugin-websr - Updated README.md to reflect new comparison feature and simplified content. - Modified package.json to remove unnecessary keywords. - Enhanced index.js to implement comparison functionality, allowing users to compare original and upscaled video. - Added new methods for enabling, disabling, and toggling comparison mode, as well as setting and getting the comparison position. - Updated TypeScript definitions to include new comparison options and methods.
This commit is contained in:
1 parent
07a5b0c0f0
commit
7dffd99cfd
308 files changed
+3175
-852
No files matched your search
@@ -5,4 +5,4 @@
|
||||
* (c) 2017-2026 Harvey Zack
|
||||
* Released under the MIT License.
|
||||
*/
|
||||
!function(e,t,r,n,a,i,s,o){var c="u">typeof globalThis?globalThis:"u">typeof self?self:"u">typeof window?window:"u">typeof global?global:{},u="function"==typeof c[n]&&c[n],l=u.i||{},d=u.cache||{},f="u">typeof module&&"function"==typeof module.require&&module.require.bind(module);function h(t,r){if(!d[t]){if(!e[t]){if(a[t])return a[t];var i="function"==typeof c[n]&&c[n];if(!r&&i)return i(t,!0);if(u)return u(t,!0);if(f&&"string"==typeof t)return f(t);var s=Error("Cannot find module '"+t+"'");throw s.code="MODULE_NOT_FOUND",s}l.resolve=function(r){var n=e[t][1][r];return null!=n?n:r},l.cache={};var o=d[t]=new h.Module(t);e[t][0].call(o.exports,l,o,o.exports,c)}return d[t].exports;function l(e){var t=l.resolve(e);if(!1===t)return{};if(Array.isArray(t)){var r={__esModule:!0};return t.forEach(function(e){var t=e[0],n=e[1],a=e[2]||e[0],i=h(n);"*"===t?Object.keys(i).forEach(function(e){"default"===e||"__esModule"===e||Object.prototype.hasOwnProperty.call(r,e)||Object.defineProperty(r,e,{enumerable:!0,get:function(){return i[e]}})}):"*"===a?Object.defineProperty(r,t,{enumerable:!0,value:i}):Object.defineProperty(r,t,{enumerable:!0,get:function(){return"default"===a?i.__esModule?i.default:i:i[a]}})}),r}return h(t)}}h.isParcelRequire=!0,h.Module=function(e){this.id=e,this.bundle=h,this.require=f,this.exports={}},h.modules=e,h.cache=d,h.parent=u,h.distDir=void 0,h.publicUrl=void 0,h.devServer=void 0,h.i=l,h.register=function(t,r){e[t]=[function(e,t){t.exports=r},{}]},Object.defineProperty(h,"root",{get:function(){return c[n]}}),c[n]=h;for(var m=0;m<t.length;m++)h(t[m]);if(r){var p=h(r);"object"==typeof exports&&"u">typeof module?module.exports=p:"function"==typeof define&&define.amd&&define(function(){return p})}}({OIaIB:[function(e,t,r,n){var a=e("@parcel/transformer-js/src/esmodule-helpers.js");a.defineInteropFlag(r),a.export(r,"default",function(){return c});var i=e("@swc/helpers/cjs/_to_consumable_array.cjs"),s=e("./VideoShim.js"),o=a.interopDefault(s);function c(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return function(t){var r=function(e){n[e]=function(){for(var t=arguments.length,r=Array(t),n=0;n<t;n++)r[n]=arguments[n];return c[e].apply(c,(0,i._)(r))}},n=(0,t.constructor.utils.createElement)("canvas"),a=n.getContext("2d"),s=new(0,o.default)({art:t,canvas:n,ctx:a,option:e}),c={};for(var u in n)"function"==typeof n[u]&&(c[u]=n[u].bind(n));var l=new Set((0,i._)(Object.getOwnPropertyNames(s)).concat((0,i._)(Object.getOwnPropertyNames(Object.getPrototypeOf(s))))),d=!0,f=!1,h=void 0;try{for(var m,p=l[Symbol.iterator]();!(d=(m=p.next()).done);d=!0)!function(){var e=m.value;"constructor"===e||e in n||Object.defineProperty(n,e,{get:function(){var t=s[e];return"function"==typeof t?t.bind(s):t},set:function(t){s[e]=t},configurable:!0,enumerable:!0})}()}catch(e){f=!0,h=e}finally{try{d||null==p.return||p.return()}finally{if(f)throw h}}for(var g in c)r(g);function v(){var e;(null==(e=t.template)?void 0:e.$player)&&!t.option.autoSize&&Object.assign(n.style,{width:"100%",height:"100%",objectFit:"contain"})}return t.on("resize",v),t.on("video:loadedmetadata",v),t.on("destroy",function(){s.destroy()}),n}}"u">typeof window&&(window.artplayerProxyMediabunny=c)},{"@swc/helpers/cjs/_to_consumable_array.cjs":"i81N6","./VideoShim.js":"45n2R","@parcel/transformer-js/src/esmodule-helpers.js":"qpMMf"}],i81N6:[function(e,t,r,n){"use strict";var a=e("d402183024004bc7"),i=e("3209e2b12672cd18"),s=e("fc58adb8f1bff142"),o=e("5e213dc122a10171");r._=function(e){return a._(e)||i._(e)||o._(e)||s._()}},{d402183024004bc7:"hfQG0","3209e2b12672cd18":"fQrlQ",fc58adb8f1bff142:"fWabh","5e213dc122a10171":"fh7mx"}],hfQG0:[function(e,t,r,n){"use strict";var a=e("5bd5b10bf87fc8e");r._=function(e){if(Array.isArray(e))return a._(e)}},{"5bd5b10bf87fc8e":"1WOAB"}],"1WOAB":[function(e,t,r,n){"use strict";r._=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}},{}],fQrlQ:[function(e,t,r,n){"use strict";r._=function(e){if("u">typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}},{}],fWabh:[function(e,t,r,n){"use strict";r._=function(){throw TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}},{}],fh7mx:[function(e,t,r,n){"use strict";var a=e("3ee51b7dc02d0c44");r._=function(e,t){if(e){if("string"==typeof e)return a._(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(r);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return a._(e,t)}}},{"3ee51b7dc02d0c44":"1WOAB"}],"45n2R":[function(e,t,r,n){var a=e("@parcel/transformer-js/src/esmodule-helpers.js");a.defineInteropFlag(r),a.export(r,"default",function(){return d});var i=e("@swc/helpers/cjs/_class_call_check.cjs"),s=e("@swc/helpers/cjs/_create_class.cjs"),o=e("./EventTarget.js"),c=a.interopDefault(oLine truncated
|
||||
!function(e,t,r,n,a){var i="u">typeof globalThis?globalThis:"u">typeof self?self:"u">typeof window?window:"u">typeof global?global:{},s="function"==typeof i[n]&&i[n],o=s.i||{},c=s.cache||{},u="u">typeof module&&"function"==typeof module.require&&module.require.bind(module);function l(t,r){if(!c[t]){if(!e[t]){if(a[t])return a[t];var o="function"==typeof i[n]&&i[n];if(!r&&o)return o(t,!0);if(s)return s(t,!0);if(u&&"string"==typeof t)return u(t);var d=Error("Cannot find module '"+t+"'");throw d.code="MODULE_NOT_FOUND",d}h.resolve=function(r){var n=e[t][1][r];return null!=n?n:r},h.cache={};var f=c[t]=new l.Module(t);e[t][0].call(f.exports,h,f,f.exports,i)}return c[t].exports;function h(e){var t=h.resolve(e);if(!1===t)return{};if(Array.isArray(t)){var r={__esModule:!0};return t.forEach(function(e){var t=e[0],n=e[1],a=e[2]||e[0],i=l(n);"*"===t?Object.keys(i).forEach(function(e){"default"===e||"__esModule"===e||Object.prototype.hasOwnProperty.call(r,e)||Object.defineProperty(r,e,{enumerable:!0,get:function(){return i[e]}})}):"*"===a?Object.defineProperty(r,t,{enumerable:!0,value:i}):Object.defineProperty(r,t,{enumerable:!0,get:function(){return"default"===a?i.__esModule?i.default:i:i[a]}})}),r}return l(t)}}l.isParcelRequire=!0,l.Module=function(e){this.id=e,this.bundle=l,this.require=u,this.exports={}},l.modules=e,l.cache=c,l.parent=s,l.distDir=void 0,l.publicUrl=void 0,l.devServer=void 0,l.i=o,l.register=function(t,r){e[t]=[function(e,t){t.exports=r},{}]},Object.defineProperty(l,"root",{get:function(){return i[n]}}),i[n]=l;for(var d=0;d<t.length;d++)l(t[d]);if(r){var f=l(r);"object"==typeof exports&&"u">typeof module?module.exports=f:"function"==typeof define&&define.amd&&define(function(){return f})}}({OIaIB:[function(e,t,r,n){var a=e("@parcel/transformer-js/src/esmodule-helpers.js");a.defineInteropFlag(r),a.export(r,"default",function(){return c});var i=e("@swc/helpers/cjs/_to_consumable_array.cjs"),s=e("./VideoShim.js"),o=a.interopDefault(s);function c(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return function(t){var r=function(e){n[e]=function(){for(var t=arguments.length,r=Array(t),n=0;n<t;n++)r[n]=arguments[n];return c[e].apply(c,(0,i._)(r))}},n=(0,t.constructor.utils.createElement)("canvas"),a=n.getContext("2d"),s=new(0,o.default)({art:t,canvas:n,ctx:a,option:e}),c={};for(var u in n)"function"==typeof n[u]&&(c[u]=n[u].bind(n));var l=new Set((0,i._)(Object.getOwnPropertyNames(s)).concat((0,i._)(Object.getOwnPropertyNames(Object.getPrototypeOf(s))))),d=!0,f=!1,h=void 0;try{for(var p,m=l[Symbol.iterator]();!(d=(p=m.next()).done);d=!0)!function(){var e=p.value;"constructor"===e||e in n||Object.defineProperty(n,e,{get:function(){var t=s[e];return"function"==typeof t?t.bind(s):t},set:function(t){s[e]=t},configurable:!0,enumerable:!0})}()}catch(e){f=!0,h=e}finally{try{d||null==m.return||m.return()}finally{if(f)throw h}}for(var g in c)r(g);function v(){var e;(null==(e=t.template)?void 0:e.$player)&&!t.option.autoSize&&Object.assign(n.style,{width:"100%",height:"100%",objectFit:"contain"})}return t.on("resize",v),t.on("video:loadedmetadata",v),t.on("destroy",function(){s.destroy()}),n}}"u">typeof window&&(window.artplayerProxyMediabunny=c)},{"@swc/helpers/cjs/_to_consumable_array.cjs":"i81N6","./VideoShim.js":"45n2R","@parcel/transformer-js/src/esmodule-helpers.js":"qpMMf"}],i81N6:[function(e,t,r,n){"use strict";var a=e("d402183024004bc7"),i=e("3209e2b12672cd18"),s=e("fc58adb8f1bff142"),o=e("5e213dc122a10171");r._=function(e){return a._(e)||i._(e)||o._(e)||s._()}},{d402183024004bc7:"hfQG0","3209e2b12672cd18":"fQrlQ",fc58adb8f1bff142:"fWabh","5e213dc122a10171":"fh7mx"}],hfQG0:[function(e,t,r,n){"use strict";var a=e("5bd5b10bf87fc8e");r._=function(e){if(Array.isArray(e))return a._(e)}},{"5bd5b10bf87fc8e":"1WOAB"}],"1WOAB":[function(e,t,r,n){"use strict";r._=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}},{}],fQrlQ:[function(e,t,r,n){"use strict";r._=function(e){if("u">typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}},{}],fWabh:[function(e,t,r,n){"use strict";r._=function(){throw TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}},{}],fh7mx:[function(e,t,r,n){"use strict";var a=e("3ee51b7dc02d0c44");r._=function(e,t){if(e){if("string"==typeof e)return a._(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(r);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return a._(e,t)}}},{"3ee51b7dc02d0c44":"1WOAB"}],"45n2R":[function(e,t,r,n){var a=e("@parcel/transformer-js/src/esmodule-helpers.js");a.defineInteropFlag(r),a.export(r,"default",function(){return d});var i=e("@swc/helpers/cjs/_class_call_check.cjs"),s=e("@swc/helpers/cjs/_create_class.cjs"),o=e("./EventTarget.js"),c=a.interopDefault(o),u=e(Line truncated
|
||||
Reference in new issue
Block a user