Aliyundrive (#436)

* init

* init

* add example

* add initControl

* add initControl

* update style

* update style

* update style

* update style

* update style

* update style

* update style

* update style

* build all

* build all

* update style
This commit is contained in:
Harvey Zack authored and GitHub committed 2022-12-31 21:16:54 +08:00
1 parent 4dcde5a539
commit 6b791be35a
52 files changed
+689 -50

No files matched your search

@@ -0,0 +1,10 @@
node_modules
.DS_Store
yarn.lock
package-lock.json
test
coverage
.nyc_output
.parcel-cache
.cache
docs
+1
View File
@@ -0,0 +1 @@
package-lock=false
@@ -0,0 +1,11 @@
# artplayer-plugin-control
Control plugin for ArtPlayer
## Demo
[https://artplayer.org](https://artplayer.org/?libs=./uncompiled/artplayer-plugin-control/index.js&example=control)
## License
MIT © Harvey Zack
@@ -0,0 +1,7 @@
/*!
* artplayer-plugin-control.js v1.0.0
* Github: https://github.com/zhw2590582/ArtPlayer
* (c) 2017-2022 Harvey Zack
* Released under the MIT License.
*/
!function(e,r,t,n,o){var i="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{},a="function"==typeof i[n]&&i[n],l=a.cache||{},p="undefined"!=typeof module&&"function"==typeof module.require&&module.require.bind(module);function u(r,t){if(!l[r]){if(!e[r]){var o="function"==typeof i[n]&&i[n];if(!t&&o)return o(r,!0);if(a)return a(r,!0);if(p&&"string"==typeof r)return p(r);var d=new Error("Cannot find module '"+r+"'");throw d.code="MODULE_NOT_FOUND",d}c.resolve=function(t){var n=e[r][1][t];return null!=n?n:t},c.cache={};var s=l[r]=new u.Module(r);e[r][0].call(s.exports,c,s,s.exports,this)}return l[r].exports;function c(e){var r=c.resolve(e);return!1===r?{}:u(r)}}u.isParcelRequire=!0,u.Module=function(e){this.id=e,this.bundle=u,this.exports={}},u.modules=e,u.cache=l,u.parent=a,u.register=function(r,t){e[r]=[function(e,r){r.exports=t},{}]},Object.defineProperty(u,"root",{get:function(){return i[n]}}),i[n]=u;for(var d=0;d<r.length;d++)u(r[d]);if(t){var s=u(t);"object"==typeof exports&&"undefined"!=typeof module?module.exports=s:"function"==typeof define&&define.amd&&define((function(){return s}))}}({"19iYR":[function(e,r,t){var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(t);var o=e("bundle-text:./style.less"),i=n.interopDefault(o);function a(){return e=>{!function(e){const{version:r,utils:{errorHandle:t}}=e.constructor,n=r.split(".").map(Number);t(n[0]+n[1]/100>=4.06,`Artplayer.js@${r} is not compatible the artplayerPluginControl@${a.version}. Please update it to version Artplayer.js@4.6.x`)}(e);const{template:{$bottom:r},constructor:{utils:{append:t,secondToTime:n,addClass:o}}}=e;o(r,"artplayer-plugin-control");const i=t(r,'<div class="apa-control-current"></div>'),l=t(r,'<div class="apa-control-duration"></div>'),p=["video:loadedmetadata","video:timeupdate","video:progress"];for(let r=0;r<p.length;r++)e.on(p[r],(()=>{i.innerText=n(e.currentTime),l.innerText=n(e.duration)}));return{name:"artplayerPluginControl"}}}if(t.default=a,a.env="production",a.version="1.0.0",a.build="2022-12-31 19:31:41","undefined"!=typeof document&&!document.getElementById("artplayer-plugin-control")){const e=document.createElement("style");e.id="artplayer-plugin-control",e.textContent=i.default,document.head.appendChild(e)}"undefined"!=typeof window&&(window.artplayerPluginControl=a)},{"bundle-text:./style.less":"71LXF","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"71LXF":[function(e,r,t){r.exports=".art-video-player .artplayer-plugin-control{height:68px;max-width:520px;user-select:none;-webkit-backdrop-filter:saturate(180%)blur(20px);backdrop-filter:saturate(180%)blur(20px);background-color:#000000b3;background-image:none;border-radius:10px;flex-direction:column;align-items:center;padding:0;font-size:13px;transition:opacity .3s;display:flex;position:absolute;bottom:10px;left:50%;transform:translate(-50%);box-shadow:0 10px 15px -3px #0003,0 4px 6px -4px #0003}.art-video-player .artplayer-plugin-control .art-progress{width:70%;justify-content:space-between;align-items:center;gap:10px;display:flex}.art-video-player .artplayer-plugin-control .art-progress .art-control-thumbnails{border-radius:5px;bottom:35px}.art-video-player .artplayer-plugin-control .art-progress .art-control-progress{width:100%}.art-video-player .artplayer-plugin-control .art-progress .art-control-progress .art-control-progress-inner{height:100%;border-radius:5px}.art-video-player .artplayer-plugin-control .art-progress .art-control-progress .art-progress-loaded,.art-video-player .artplayer-plugin-control .art-progress .art-control-progress .art-progress-played{border-radius:5px}.art-video-player .artplayer-plugin-control .art-controls{width:100%;height:auto;flex:1;padding:0 5px}.art-video-player .artplayer-plugin-control .art-controls .art-control-time{display:none}.art-video-player .artplayer-plugin-control .art-controls .art-volume-panel{width:60px!important}.art-video-player .artplayer-plugin-control .apa-control-current,.art-video-player .artplayer-plugin-control .apa-control-duration{width:15%;justify-content:center;line-height:1;display:flex;position:absolute;top:10px}.art-video-player .artplayer-plugin-control .apa-control-current{left:0}.art-video-player .artplayer-plugin-control .apa-control-duration{right:0}.art-video-player.art-control-show .art-subtitle{bottom:80px}"},{}],"9pCYc":[function(e,r,t){t.interopDefault=function(e){return e&&e.__esModule?e:{default:e}},t.defineInteropFlag=function(e){Object.defineProperty(e,"__esModule",{value:!0})},t.exportAll=function(e,r){return Object.keys(e).forEach((function(t){"default"===t||"__esModule"===t||r.hasOwnProperty(t)||Object.defineProperty(r,t,{enumerable:!0,get:function(){return e[t]}})})),r},t.export=function(e,r,t){Object.defineProperty(e,r,{enumerable:!0,get:t})}},{}]},["19iYR"],"19iYR","parcelRequire4dc0");
@@ -0,0 +1,7 @@
/*!
* artplayer-plugin-control.js v1.0.0
* Github: https://github.com/zhw2590582/ArtPlayer
* (c) 2017-2022 Harvey Zack
* Released under the MIT License.
*/
!function(e,r,t,n,o){var a="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{},i="function"==typeof a[n]&&a[n],l=i.cache||{},p="undefined"!=typeof module&&"function"==typeof module.require&&module.require.bind(module);function u(r,t){if(!l[r]){if(!e[r]){var o="function"==typeof a[n]&&a[n];if(!t&&o)return o(r,!0);if(i)return i(r,!0);if(p&&"string"==typeof r)return p(r);var d=new Error("Cannot find module '"+r+"'");throw d.code="MODULE_NOT_FOUND",d}c.resolve=function(t){var n=e[r][1][t];return null!=n?n:t},c.cache={};var s=l[r]=new u.Module(r);e[r][0].call(s.exports,c,s,s.exports,this)}return l[r].exports;function c(e){var r=c.resolve(e);return!1===r?{}:u(r)}}u.isParcelRequire=!0,u.Module=function(e){this.id=e,this.bundle=u,this.exports={}},u.modules=e,u.cache=l,u.parent=i,u.register=function(r,t){e[r]=[function(e,r){r.exports=t},{}]},Object.defineProperty(u,"root",{get:function(){return a[n]}}),a[n]=u;for(var d=0;d<r.length;d++)u(r[d]);if(t){var s=u(t);"object"==typeof exports&&"undefined"!=typeof module?module.exports=s:"function"==typeof define&&define.amd&&define((function(){return s}))}}({"1MB70":[function(e,r,t){var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(t);var o=e("bundle-text:./style.less"),a=n.interopDefault(o);function i(){return e=>{!function(e){const{version:r,utils:{errorHandle:t}}=e.constructor,n=r.split(".").map(Number);t(n[0]+n[1]/100>=4.06,`Artplayer.js@${r} is not compatible the artplayerPluginControl@${i.version}. Please update it to version Artplayer.js@4.6.x`)}(e);const{template:{$bottom:r},constructor:{utils:{append:t,secondToTime:n,addClass:o}}}=e;o(r,"artplayer-plugin-control");const a=t(r,'<div class="apa-control-current"></div>'),l=t(r,'<div class="apa-control-duration"></div>'),p=["video:loadedmetadata","video:timeupdate","video:progress"];for(let r=0;r<p.length;r++)e.on(p[r],(()=>{a.innerText=n(e.currentTime),l.innerText=n(e.duration)}));return{name:"artplayerPluginControl"}}}if(t.default=i,i.env="production",i.version="1.0.0",i.build="2022-12-31 19:31:42","undefined"!=typeof document&&!document.getElementById("artplayer-plugin-control")){const e=document.createElement("style");e.id="artplayer-plugin-control",e.textContent=a.default,document.head.appendChild(e)}"undefined"!=typeof window&&(window.artplayerPluginControl=i)},{"bundle-text:./style.less":"k4YuG","@parcel/transformer-js/src/esmodule-helpers.js":"47PTV"}],k4YuG:[function(e,r,t){r.exports=".art-video-player .artplayer-plugin-control{height:68px;max-width:520px;-webkit-user-select:none;user-select:none;-webkit-backdrop-filter:saturate(180%)blur(20px);-webkit-backdrop-filter:saturate(180%)blur(20px);-webkit-backdrop-filter:saturate(180%)blur(20px);backdrop-filter:saturate(180%)blur(20px);background-color:#000000b3;background-image:none;border-radius:10px;flex-direction:column;align-items:center;padding:0;font-size:13px;transition:opacity .3s;display:flex;position:absolute;bottom:10px;left:50%;transform:translate(-50%);box-shadow:0 10px 15px -3px #0003,0 4px 6px -4px #0003}.art-video-player .artplayer-plugin-control .art-progress{width:70%;justify-content:space-between;align-items:center;gap:10px;display:flex}.art-video-player .artplayer-plugin-control .art-progress .art-control-thumbnails{border-radius:5px;bottom:35px}.art-video-player .artplayer-plugin-control .art-progress .art-control-progress{width:100%}.art-video-player .artplayer-plugin-control .art-progress .art-control-progress .art-control-progress-inner{height:100%;border-radius:5px}.art-video-player .artplayer-plugin-control .art-progress .art-control-progress .art-progress-loaded,.art-video-player .artplayer-plugin-control .art-progress .art-control-progress .art-progress-played{border-radius:5px}.art-video-player .artplayer-plugin-control .art-controls{width:100%;height:auto;flex:1;padding:0 5px}.art-video-player .artplayer-plugin-control .art-controls .art-control-time{display:none}.art-video-player .artplayer-plugin-control .art-controls .art-volume-panel{width:60px!important}.art-video-player .artplayer-plugin-control .apa-control-current,.art-video-player .artplayer-plugin-control .apa-control-duration{width:15%;justify-content:center;line-height:1;display:flex;position:absolute;top:10px}.art-video-player .artplayer-plugin-control .apa-control-current{left:0}.art-video-player .artplayer-plugin-control .apa-control-duration{right:0}.art-video-player.art-control-show .art-subtitle{bottom:80px}"},{}],"47PTV":[function(e,r,t){t.interopDefault=function(e){return e&&e.__esModule?e:{default:e}},t.defineInteropFlag=function(e){Object.defineProperty(e,"__esModule",{value:!0})},t.exportAll=function(e,r){return Object.keys(e).forEach((function(t){"default"===t||"__esModule"===t||r.hasOwnProperty(t)||Object.defineProperty(r,t,{enumerable:!0,get:function(){return e[t]}})})),r},t.export=function(e,r,t){Object.defineProperty(e,r,{enumerable:!0,getLine truncated
@@ -0,0 +1,7 @@
/*!
* artplayer-plugin-control.js v1.0.0
* Github: https://github.com/zhw2590582/ArtPlayer
* (c) 2017-2022 Harvey Zack
* Released under the MIT License.
*/
!function(t,e,r,o,n){var a="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{},l="function"==typeof a[o]&&a[o],i=l.cache||{},p="undefined"!=typeof module&&"function"==typeof module.require&&module.require.bind(module);function u(e,r){if(!i[e]){if(!t[e]){var n="function"==typeof a[o]&&a[o];if(!r&&n)return n(e,!0);if(l)return l(e,!0);if(p&&"string"==typeof e)return p(e);var c=new Error("Cannot find module '"+e+"'");throw c.code="MODULE_NOT_FOUND",c}d.resolve=function(r){var o=t[e][1][r];return null!=o?o:r},d.cache={};var s=i[e]=new u.Module(e);t[e][0].call(s.exports,d,s,s.exports,this)}return i[e].exports;function d(t){var e=d.resolve(t);return!1===e?{}:u(e)}}u.isParcelRequire=!0,u.Module=function(t){this.id=t,this.bundle=u,this.exports={}},u.modules=t,u.cache=i,u.parent=l,u.register=function(e,r){t[e]=[function(t,e){e.exports=r},{}]},Object.defineProperty(u,"root",{get:function(){return a[o]}}),a[o]=u;for(var c=0;c<e.length;c++)u(e[c]);if(r){var s=u(r);"object"==typeof exports&&"undefined"!=typeof module?module.exports=s:"function"==typeof define&&define.amd&&define((function(){return s}))}}({"16V0T":[function(t,e,r){var o=t("@parcel/transformer-js/src/esmodule-helpers.js");o.defineInteropFlag(r);var n=t("bundle-text:./style.less"),a=o.interopDefault(n);function l(){return t=>{!function(t){const{version:e,utils:{errorHandle:r}}=t.constructor,o=e.split(".").map(Number);r(o[0]+o[1]/100>=4.06,`Artplayer.js@${e} is not compatible the artplayerPluginControl@${l.version}. Please update it to version Artplayer.js@4.6.x`)}(t);const{template:{$bottom:e,$player:r},constructor:{utils:{append:o,secondToTime:n,addClass:a}}}=t;a(r,"artplayer-plugin-control");const i=o(e,'<div class="apa-control-current"></div>'),p=o(e,'<div class="apa-control-duration"></div>'),u=["video:loadedmetadata","video:timeupdate","video:progress"];for(let e=0;e<u.length;e++)t.on(u[e],(()=>{i.innerText=n(t.currentTime),p.innerText=n(t.duration)}));return{name:"artplayerPluginControl"}}}if(r.default=l,l.env="production",l.version="1.0.0",l.build="2022-12-31 21:04:23","undefined"!=typeof document&&!document.getElementById("artplayer-plugin-control")){const t=document.createElement("style");t.id="artplayer-plugin-control",t.textContent=a.default,document.head.appendChild(t)}"undefined"!=typeof window&&(window.artplayerPluginControl=l)},{"bundle-text:./style.less":"klrMD","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],klrMD:[function(t,e,r){e.exports=".artplayer-plugin-control .art-bottom{height:68px;max-width:520px;user-select:none;-webkit-backdrop-filter:saturate(180%)blur(20px);backdrop-filter:saturate(180%)blur(20px);background-color:#000000b3;background-image:none;border-radius:10px;flex-direction:column;align-items:center;padding:0;font-size:13px;transition:opacity .3s;display:flex;position:absolute;bottom:10px;left:50%;transform:translate(-50%);box-shadow:0 10px 15px -3px #0003,0 4px 6px -4px #0003}.artplayer-plugin-control .art-bottom .art-progress{width:70%;justify-content:space-between;align-items:center;gap:10px;display:flex}.artplayer-plugin-control .art-bottom .art-progress .art-control-thumbnails{bottom:35px}.artplayer-plugin-control .art-bottom .art-progress .art-control-progress{width:100%}.artplayer-plugin-control .art-bottom .art-progress .art-progress-tip{top:-40px!important}.artplayer-plugin-control .art-bottom .art-controls{width:100%;height:auto;flex:1;padding:0 5px}.artplayer-plugin-control .art-bottom .art-controls .art-control-time{display:none}.artplayer-plugin-control .art-bottom .art-controls .art-volume-panel{width:60px!important}.artplayer-plugin-control .art-bottom .art-selector-list{background-color:#000c!important}.artplayer-plugin-control .art-bottom .apa-control-current,.artplayer-plugin-control .art-bottom .apa-control-duration{width:15%;justify-content:center;line-height:1;display:flex;position:absolute;top:10px}.artplayer-plugin-control .art-bottom .apa-control-current{left:0}.artplayer-plugin-control .art-bottom .apa-control-duration{right:0}.artplayer-plugin-control .art-settings{bottom:85px}.artplayer-plugin-control.art-control-show .art-subtitle{bottom:80px}.apa-control-current,.apa-control-duration{display:none}"},{}],"9pCYc":[function(t,e,r){r.interopDefault=function(t){return t&&t.__esModule?t:{default:t}},r.defineInteropFlag=function(t){Object.defineProperty(t,"__esModule",{value:!0})},r.exportAll=function(t,e){return Object.keys(t).forEach((function(r){"default"===r||"__esModule"===r||e.hasOwnProperty(r)||Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[r]}})})),e},r.export=function(t,e,r){Object.defineProperty(t,e,{enumerable:!0,get:r})}},{}]},["16V0T"],"16V0T","parcelRequire4dc0");
@@ -0,0 +1,7 @@
/*!
* artplayer-plugin-control.js v1.0.0
* Github: https://github.com/zhw2590582/ArtPlayer
* (c) 2017-2022 Harvey Zack
* Released under the MIT License.
*/
!function(t,e,r,o,n){var a="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{},l="function"==typeof a[o]&&a[o],i=l.cache||{},p="undefined"!=typeof module&&"function"==typeof module.require&&module.require.bind(module);function u(e,r){if(!i[e]){if(!t[e]){var n="function"==typeof a[o]&&a[o];if(!r&&n)return n(e,!0);if(l)return l(e,!0);if(p&&"string"==typeof e)return p(e);var c=new Error("Cannot find module '"+e+"'");throw c.code="MODULE_NOT_FOUND",c}d.resolve=function(r){var o=t[e][1][r];return null!=o?o:r},d.cache={};var s=i[e]=new u.Module(e);t[e][0].call(s.exports,d,s,s.exports,this)}return i[e].exports;function d(t){var e=d.resolve(t);return!1===e?{}:u(e)}}u.isParcelRequire=!0,u.Module=function(t){this.id=t,this.bundle=u,this.exports={}},u.modules=t,u.cache=i,u.parent=l,u.register=function(e,r){t[e]=[function(t,e){e.exports=r},{}]},Object.defineProperty(u,"root",{get:function(){return a[o]}}),a[o]=u;for(var c=0;c<e.length;c++)u(e[c]);if(r){var s=u(r);"object"==typeof exports&&"undefined"!=typeof module?module.exports=s:"function"==typeof define&&define.amd&&define((function(){return s}))}}({d3G6W:[function(t,e,r){var o=t("@parcel/transformer-js/src/esmodule-helpers.js");o.defineInteropFlag(r);var n=t("bundle-text:./style.less"),a=o.interopDefault(n);function l(){return t=>{!function(t){const{version:e,utils:{errorHandle:r}}=t.constructor,o=e.split(".").map(Number);r(o[0]+o[1]/100>=4.06,`Artplayer.js@${e} is not compatible the artplayerPluginControl@${l.version}. Please update it to version Artplayer.js@4.6.x`)}(t);const{template:{$bottom:e,$player:r},constructor:{utils:{append:o,secondToTime:n,addClass:a}}}=t;a(r,"artplayer-plugin-control");const i=o(e,'<div class="apa-control-current"></div>'),p=o(e,'<div class="apa-control-duration"></div>'),u=["video:loadedmetadata","video:timeupdate","video:progress"];for(let e=0;e<u.length;e++)t.on(u[e],(()=>{i.innerText=n(t.currentTime),p.innerText=n(t.duration)}));return{name:"artplayerPluginControl"}}}if(r.default=l,l.env="production",l.version="1.0.0",l.build="2022-12-31 21:04:24","undefined"!=typeof document&&!document.getElementById("artplayer-plugin-control")){const t=document.createElement("style");t.id="artplayer-plugin-control",t.textContent=a.default,document.head.appendChild(t)}"undefined"!=typeof window&&(window.artplayerPluginControl=l)},{"bundle-text:./style.less":"8jCnX","@parcel/transformer-js/src/esmodule-helpers.js":"47PTV"}],"8jCnX":[function(t,e,r){e.exports=".artplayer-plugin-control .art-bottom{height:68px;max-width:520px;-webkit-user-select:none;user-select:none;-webkit-backdrop-filter:saturate(180%)blur(20px);-webkit-backdrop-filter:saturate(180%)blur(20px);-webkit-backdrop-filter:saturate(180%)blur(20px);backdrop-filter:saturate(180%)blur(20px);background-color:#000000b3;background-image:none;border-radius:10px;flex-direction:column;align-items:center;padding:0;font-size:13px;transition:opacity .3s;display:flex;position:absolute;bottom:10px;left:50%;transform:translate(-50%);box-shadow:0 10px 15px -3px #0003,0 4px 6px -4px #0003}.artplayer-plugin-control .art-bottom .art-progress{width:70%;justify-content:space-between;align-items:center;gap:10px;display:flex}.artplayer-plugin-control .art-bottom .art-progress .art-control-thumbnails{bottom:35px}.artplayer-plugin-control .art-bottom .art-progress .art-control-progress{width:100%}.artplayer-plugin-control .art-bottom .art-progress .art-progress-tip{top:-40px!important}.artplayer-plugin-control .art-bottom .art-controls{width:100%;height:auto;flex:1;padding:0 5px}.artplayer-plugin-control .art-bottom .art-controls .art-control-time{display:none}.artplayer-plugin-control .art-bottom .art-controls .art-volume-panel{width:60px!important}.artplayer-plugin-control .art-bottom .art-selector-list{background-color:#000c!important}.artplayer-plugin-control .art-bottom .apa-control-current,.artplayer-plugin-control .art-bottom .apa-control-duration{width:15%;justify-content:center;line-height:1;display:flex;position:absolute;top:10px}.artplayer-plugin-control .art-bottom .apa-control-current{left:0}.artplayer-plugin-control .art-bottom .apa-control-duration{right:0}.artplayer-plugin-control .art-settings{bottom:85px}.artplayer-plugin-control.art-control-show .art-subtitle{bottom:80px}.apa-control-current,.apa-control-duration{display:none}"},{}],"47PTV":[function(t,e,r){r.interopDefault=function(t){return t&&t.__esModule?t:{default:t}},r.defineInteropFlag=function(t){Object.defineProperty(t,"__esModule",{value:!0})},r.exportAll=function(t,e){return Object.keys(t).forEach((function(r){"default"===r||"__esModule"===r||e.hasOwnProperty(r)||Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[r]}})})),e},r.export=function(t,e,r){Object.defineProperty(t,e,{enumerable:!0,get:r})}},{}]},["d3G6W"],"d3G6W","parcelRequire4dc0");
@@ -0,0 +1,24 @@
{
"license": "MIT",
"version": "1.0.0",
"name": "artplayer-plugin-control",
"types": "types/artplayer-plugin-control.d.ts",
"description": "Control plugin for ArtPlayer",
"main": "dist/artplayer-plugin-control.js",
"legacy": "dist/artplayer-plugin-control.legacy.js",
"author": "Harvey Zack <laozhaochaguan@gmail.com>",
"browserslist": "> 0.5%, last 2 versions, not dead",
"homepage": "https://artplayer.org",
"repository": {
"type": "git",
"url": "git+https://github.com/zhw2590582/ArtPlayer.git"
},
"bugs": {
"url": "https://github.com/zhw2590582/ArtPlayer/issues"
},
"keywords": [
"html5",
"video",
"player"
]
}
@@ -0,0 +1,74 @@
import style from 'bundle-text:./style.less';
function checkVersion(art) {
const {
version,
utils: { errorHandle },
} = art.constructor;
const arr = version.split('.').map(Number);
const major = arr[0];
const minor = arr[1] / 100;
errorHandle(
major + minor >= 4.06,
`Artplayer.js@${version} is not compatible the artplayerPluginControl@${artplayerPluginControl.version}. Please update it to version Artplayer.js@4.6.x`,
);
}
export default function artplayerPluginControl() {
return (art) => {
checkVersion(art);
const {
template: { $bottom, $player },
constructor: {
utils: { append, secondToTime, addClass, removeClass, hasClass },
},
} = art;
const className = 'artplayer-plugin-control';
addClass($player, className);
const $current = append($bottom, `<div class="apa-control-current"></div>`);
const $duration = append($bottom, `<div class="apa-control-duration"></div>`);
const events = ['video:loadedmetadata', 'video:timeupdate', 'video:progress'];
for (let index = 0; index < events.length; index++) {
art.on(events[index], () => {
$current.innerText = secondToTime(art.currentTime);
$duration.innerText = secondToTime(art.duration);
});
}
return {
name: 'artplayerPluginControl',
get enable() {
return hasClass($player, className);
},
set enable(state) {
if (state) {
addClass($player, className);
} else {
removeClass($player, className);
}
},
};
};
}
artplayerPluginControl.env = process.env.NODE_ENV;
artplayerPluginControl.version = process.env.APP_VER;
artplayerPluginControl.build = process.env.BUILD_DATE;
if (typeof document !== 'undefined') {
if (!document.getElementById('artplayer-plugin-control')) {
const $style = document.createElement('style');
$style.id = 'artplayer-plugin-control';
$style.textContent = style;
document.head.appendChild($style);
}
}
if (typeof window !== 'undefined') {
window['artplayerPluginControl'] = artplayerPluginControl;
}
@@ -0,0 +1,95 @@
.artplayer-plugin-control {
.art-bottom {
display: flex;
align-items: center;
flex-direction: column;
position: absolute;
height: 68px;
max-width: 520px;
user-select: none;
border-radius: 10px;
transition: opacity 0.3s ease;
left: 50%;
transform: translateX(-50%);
bottom: 10px;
font-size: 13px;
-webkit-backdrop-filter: saturate(180%) blur(20px);
backdrop-filter: saturate(180%) blur(20px);
background-color: rgba(0, 0, 0, 0.7);
box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.2), 0 4px 6px -4px rgb(0 0 0 / 0.2);
background-image: none;
padding: 0;
.art-progress {
width: 65%;
display: flex;
align-items: center;
justify-content: space-between;
gap: 10px;
.art-control-thumbnails {
bottom: 35px;
}
.art-control-progress {
width: 100%;
}
.art-progress-tip {
top: -40px !important;
}
}
.art-controls {
width: 100%;
height: auto;
flex: 1;
padding: 0 5px;
.art-control-time {
display: none;
}
.art-volume-panel {
width: 60px !important;
}
}
.art-selector-list {
background-color: rgba(0, 0, 0, 0.8) !important;
}
.apa-control-current,
.apa-control-duration {
display: flex;
justify-content: center;
line-height: 1;
width: 17.5%;
position: absolute;
top: 10px;
}
.apa-control-current {
left: 0;
}
.apa-control-duration {
right: 0;
}
}
.art-settings {
bottom: 85px;
}
&.art-control-show {
.art-subtitle {
bottom: 80px;
}
}
}
.apa-control-current,
.apa-control-duration {
display: none;
}
@@ -0,0 +1,13 @@
import type Artplayer from 'artplayer';
export = artplayerPluginControl;
export as namespace artplayerPluginControl;
type Option = {};
type Control = {
name: 'artplayerPluginControl';
enable: Boolean;
};
declare const artplayerPluginControl: (option?: Option) => (art: Artplayer) => Control;