ÿØÿà JFIF ÿÛ „ ( %"1"%)+...383,7(-.-
![]() Server : Apache/2.4.6 (CentOS) OpenSSL/1.0.2k-fips PHP/7.4.20 System : Linux st2.domain.com 3.10.0-1127.10.1.el7.x86_64 #1 SMP Wed Jun 3 14:28:03 UTC 2020 x86_64 User : apache ( 48) PHP Version : 7.4.20 Disable Function : NONE Directory : /var/www/html/netphim/layout/default/node_modules/artplayer/src/plugins/ |
import { errorHandle, isMobile, has, def } from '../utils'; import miniProgressBar from './miniProgressBar'; import autoOrientation from './autoOrientation'; import autoPlayback from './autoPlayback'; import fastForward from './fastForward'; import lock from './lock'; export default class Plugins { constructor(art) { this.art = art; this.id = 0; const { option } = art; if (option.miniProgressBar && !option.isLive) { this.add(miniProgressBar); } if (option.lock && isMobile) { this.add(lock); } if (option.autoPlayback && !option.isLive) { this.add(autoPlayback); } if (option.autoOrientation && isMobile) { this.add(autoOrientation); } if (option.fastForward && isMobile && !option.isLive) { this.add(fastForward); } for (let index = 0; index < option.plugins.length; index++) { this.add(option.plugins[index]); } } add(plugin) { this.id += 1; const result = plugin.call(this.art, this.art); const pluginName = (result && result.name) || plugin.name || `plugin${this.id}`; errorHandle(!has(this, pluginName), `Cannot add a plugin that already has the same name: ${pluginName}`); def(this, pluginName, { value: result, }); return this; } }