mirror of
https://github.com/letian1650/N3RD.git
synced 2025-01-31 00:04:50 +08:00
7 lines
56 KiB
JavaScript
7 lines
56 KiB
JavaScript
|
/*!
|
|||
|
* Mui Player Desktop Plugin Javascript Library v1.4.1
|
|||
|
* Date:2022-01-16
|
|||
|
* Released under GPL-3.0 license
|
|||
|
* https://muiplayer.js.org/
|
|||
|
*/
|
|||
|
"use strict";function _toConsumableArray(e){return _arrayWithoutHoles(e)||_iterableToArray(e)||_unsupportedIterableToArray(e)||_nonIterableSpread()}function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _iterableToArray(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function _arrayWithoutHoles(e){if(Array.isArray(e))return _arrayLikeToArray(e)}function _createForOfIteratorHelper(e,t){var o="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!o){if(Array.isArray(e)||(o=_unsupportedIterableToArray(e))||t&&e&&"number"==typeof e.length){o&&(e=o);var n=0,t=function(){};return{s:t,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:t}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var l,i=!0,r=!1;return{s:function(){o=o.call(e)},n:function(){var e=o.next();return i=e.done,e},e:function(e){r=!0,l=e},f:function(){try{i||null==o.return||o.return()}finally{if(r)throw l}}}}function _unsupportedIterableToArray(e,t){if(e){if("string"==typeof e)return _arrayLikeToArray(e,t);var o=Object.prototype.toString.call(e).slice(8,-1);return"Map"===(o="Object"===o&&e.constructor?e.constructor.name:o)||"Set"===o?Array.from(e):"Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o)?_arrayLikeToArray(e,t):void 0}}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var o=0,n=new Array(t);o<t;o++)n[o]=e[o];return n}function _typeof(e){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}!function(e,t){"object"==("undefined"==typeof exports?"undefined":_typeof(exports))&&"object"==("undefined"==typeof module?"undefined":_typeof(module))?module.exports=t():"function"==typeof define&&_typeof(define.amd)?define(t):e.MuiPlayerDesktopPlugin=t()}(window,function(){return function(m){function u(){return{defaults:[{functions:"循环播放",name:"loopPlay",show:!0,model:"switch",selected:!1,onToggle:function(e,t,o){t(),e.event.currentTarget.querySelector(".toogle-switch").classList.contains("open")?f.$el.videoObject.loop=!0:f.$el.videoObject.loop=!1}},{functions:"播放速度",name:"playbackRate",show:!0,model:"select",childConfig:[{functions:"0.25"},{functions:"0.5"},{functions:"0.75"},{functions:"正常",selected:!0},{functions:"1.25"},{functions:"1.5"},{functions:"1.75"},{functions:"2"}],onToggle:function(e,t,o){t(),o();o=f.$method.getLangObject(),e=e.functions;isNaN(parseFloat(e))?(f.$el.videoObject.playbackRate=1,h.rst(o.dsps)):(f.$el.videoObject.playbackRate=parseFloat(e),h.rst(o.tsps.replace("?",e)))}}],subtitle:{functions:"字幕",name:"subtitle",childConfig:[{functions:"打开",name:"loopPlay",model:"switch",selected:!0},{functions:"选择语言",childConfig:[],onToggle:function(o,n,e){var l=o.getPanelOption(o.panelIndex,"parent").panelIndex,i=f.$el.videoObject.textTracks;i&&i instanceof TextTrackList?function(){for(var e=0;e<i.length;e++){var t=i[e];o.functions==t.label?(t.mode="showing",o.getPanelOption(l,"parent").childConfig[0].selected=!0,n()):"showing"==t.mode&&(t.mode="hidden")}}():h.rst("the textTracks api is not supported by the browser.")}}],onToggle:function(a,s,e){var c=a.event.currentTarget.querySelector(".toogle-switch").classList.contains("open"),u=f.$el.videoObject.textTracks;u&&u instanceof TextTrackList?function(){if(c)for(var e=0;e<u.length;e++){var t=u[e];"showing"==t.mode&&(t.mode="hidden")}else for(var o=a.getPanelOption(a.panelIndex,"parent").childConfig[1].childConfig,e=0;e<u.length;e++){var n,l=u[e],i=_createForOfIteratorHelper(o);try{for(i.s();!(n=i.n()).done;){var r=n.value;if(l.label==r.functions&&1==r.selected){l.mode="showing";break}}}catch(e){i.e(e)}finally{i.f()}}s()}(
|