dysproseum / kplaylist-php7

kPlaylist is a free PHP system that makes your music collection available via the Internet.
GNU General Public License v2.0
3 stars 2 forks source link

Modular plugins? #13

Open dysproseum opened 4 months ago

dysproseum commented 4 months ago

Insert modules

Includes their functions Create extension hooks:

foreach (glob(modules/*.php) include module.info;
if (enabled) include module/module.php

Examples:

dysproseum commented 4 months ago
{modules:
- iframe,
- mobile_layout,
- html5player:
  - dependencies:
    - iframe
- webamp:
  - dependencies:
    - iframe
- flac stream:
  - dependencies:
    - html5player
}

but these are all interconnected through css; the players have to support if mobile is enabled, and have to work closely with iframe, and the alternate stream actions could be used outside of html5player. so should they be modules or be part of core?

dysproseum commented 4 months ago

the modules could either be optional features like: if (file_exists(custom/module.php)) include custom/module.php;

or they could load them dynamically like above: foreach (glob(modules/*.php) include module.info;

but then it would mean more defined hooks and interface vs. placing the methods where they are needed.

dysproseum commented 4 months ago

for the best experience, the player should probably move to a dropdown instead of multiple checkboxes.

and iframe layout and mobile layout could stay as either/both options.

could either be:

  1. mobile and no custom player
  2. mobile and custom player (enables iframe)
  3. no mobile and no custom player
  4. no mobile and custom player (enables iframe)

also mobile css should be overriding stock css, not external.js.

dysproseum commented 4 months ago

The player really could be a user preference too.

Like there is for themes, and there is a theme loader at the top of the file too.

dysproseum commented 4 months ago

This work is in progress in #14

Players were taken out of core and put into themes.

Mobile.css is staying in core, and the themes can add their own mobile.css extensions if needed.

dysproseum commented 4 months ago

Few issues:

dysproseum commented 4 months ago

https://stackoverflow.com/questions/38334779/how-to-call-function-of-another-iframe

Parent page (iframe.php) - stores childCollection of callbacks