Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Starting point #1

Open
Micu22 opened this issue Apr 12, 2021 · 6 comments
Open

Starting point #1

Micu22 opened this issue Apr 12, 2021 · 6 comments

Comments

@Micu22
Copy link
Owner

Micu22 commented Apr 12, 2021

@Lewiscowles1986
Hi so I created a repo and added some boilerplate

@Lewiscowles1986
Copy link
Contributor

Hey 👋

I Don't think it should matter if it's singular. Might as well load the javascript if !is_admin() or any suitable hook.

One issue would be that I doubt this would be enqueued in Gutenberg editor, so the person would need to preview or visit a saved version to reason about the end look & feel. I Think that is a step-backward.

What are your goals for this?

@Lewiscowles1986
Copy link
Contributor

Oh, it also needs a license. Is everything under GPL2+ an issue?

@Micu22
Copy link
Owner Author

Micu22 commented Apr 12, 2021

Right, so I got interested it all this, because one particular client of mine needed a specifically styled player.
So I need to do at least some thinking before I (or we) begin.
I see two options, build it to be a handler for mediaelement.js or write a custom js player. (mediaelement.js weights 120kb)

No matter which option we choose the end result should let people style the players in different ways, preferably via settings inside Gutenberg (and see the styles applied in the editor too). At first we can aim for the audio player because this is easier. Or maybe it's better to plan it beforehand for all players ?

As you can see I myself have more questions than answers. I am willing to put some time, so maybe you can tell me what would be the most useful thing for the wp community and we would try to met these needs?

Or we can aim at this as a podcasting solution for wp?

I don't really know much about licensing, I always put GPLv3 in my plugins, but I may be doing it wrong.

The singular check I just copied from the code I have written for my client. Obviously it's not mandatory.

@Lewiscowles1986
Copy link
Contributor

Right, so I got interested it all this, because one particular client of mine needed a specifically styled player.

Understood. To be clear I'm not interested in their specific needs.

I see two options, build it to be a handler for mediaelement.js or write a custom js player. (mediaelement.js weights 120kb)

YMMV, but I would suggest using something existing. There are other player solutions besides mediaelement.js, but 120kb is not so much considering the media will likely be MB in size per-file, per-format.

No matter which option we choose the end result should let people style the players in different ways

I Would encourage perhaps making that your own long-term goal and one that is larger than the plugin. I Can share with you some OpenSource repo's I've worked on to get filters to allow other plugins to extend, avoiding hot-takes, but ultimately. If you try to please everyone. You might wind up taking a lot of your time helping noone.

preferably via settings inside Gutenberg (and see the styles applied in the editor too).

Again, eat the elephant in small-bites. This is two large, and not defined, designed or otherwise goals.

At first we can aim for the audio player because this is easier. Or maybe it's better to plan it beforehand for all players ?

Aim for a single player-type. MediaElement supports many, but it's best to anchor yourself on one thing at a time.

Who other than a commercial client can test, and give honest feedback?

As you can see I myself have more questions than answers.

Humility is golden. I Love that this is your outlook.

I am willing to put some time, so maybe you can tell me what would be the most useful thing for the wp community and we would try to met these needs?

I Can't speak for the entire WordPress community, but if we can both come up with questions, designs and working prototypes, I am sure they will be forthcoming with opinions.

Or we can aim at this as a podcasting solution for wp?

Best to ask people with a need about that. You could ask your client. Have two people who have asked for changes to a free plugin, where they have asked for an editor. I've said I'll see about it when I have time as these are not currently framed as commercial opportunities and I need to prioritize spending time on potentially endless projects.

I don't really know much about licensing, I always put GPLv3 in my plugins, but I may be doing it wrong.

Please don't take any of my questions or responses as "You're doing it wrong". Even if I said that, I didn't mean it. Licensing is important to have a separate LICENSE or LICENSE.txt for a repo so that people know the rues of contribution, what we might expect and what a community might be required to do to use software we work hard on. It's just about setting expectations. I Missed the GPL on this, but I see it is GPLv3, so getting a LICENSE for that might help communicate it.

The singular check I just copied from the code I have written for my client. Obviously it's not mandatory.

Is there a way to deliver something that you can customize for your client using a sister-plugin, so that a core OpenSource work would not need to be, concerned with the specifics of their organization?

I'll make a LICENSE PR in the mean time.

@Micu22
Copy link
Owner Author

Micu22 commented Apr 13, 2021

The thing I made for my client I have written inside their theme, I have finished that part yesterday, so this project is a separate thing.

I have searched for some js player libraries, I found two others we might want to look at:
Plyr.js: https://github.com/sampotts/plyr
Video.js: https://github.com/videojs/video.js
Plyr can be used without npm, so this one is probably more suitable. Question mediaelement.js or plyr.js?

If we are going to make just a simple thingy which enqueues the player and embeds it on the page with some filters then okay.

So what we need:

  1. Properly enqueue the chosen player in the right places.
  2. Make it embed itself in place of audio tags.
  3. Provide some styling (maybe just the supplied by the library css file)
  4. Let other plugins disable this css file and use their own css file.

@Lewiscowles1986
Copy link
Contributor

How about we have a default config for whichever player we choose to bind to, which we can switch using hooks, by just using apply_filters?

How about instead of making decisions about where to embed it. We also use a filter to specify an array of selectors, with default to audio for now, so that we can play around with that also?

With just these two things, you can have a remarkably small core-plugin, that enables you to use whichever player you choose, and iterate on those decisions later.

RE: CSS, I think just enqueuing with a filter, also lets us... Change our minds and learn later.

Btw anything that uses NPM just means we get a build-step before releasing to plugin directory. It shouldn't affect WordPress as webpack or similar can be setup to bundle dependencies into one or more files. MediaElement.js certainly supports this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants