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

[ENHANCEMENT] - Ability to switch player used #325

Open
chrisreddington opened this issue Dec 12, 2020 · 1 comment
Open

[ENHANCEMENT] - Ability to switch player used #325

chrisreddington opened this issue Dec 12, 2020 · 1 comment

Comments

@chrisreddington
Copy link
Contributor

Is your feature request related to a problem? Please describe.
I had an e-mail about my Podcast the other day from the team at Podscribe. Their offering looks interesting. They have quite a nice player that will allow you to select text and play from that point, or scroll the text in line with the player.

Describe the solution you'd like
The theme to support multiple players, and we have a configuration option to choose which player is used.

Describe alternatives you've considered
N/A - Hopefully this should be possible

Additional context
The main context is in the above feature request. However, from some of the recent work that i've been doing alongside @mattstratton, I wonder if this is also an opportunity to look at how partials can be used across the theme overall, and reduce some of the duplication of code. Happy to make a separate issue to track that.

@mattstratton
Copy link
Owner

First thoughts are that this might seem easily handled with partials, but the reality is that the audio player is handled in a bunch of places - it's basically just displayed in the various row/episode partials, but since it's a javascript-based player, there is stuff that gets concatenated into a single javascript file (castanet-min.js) which is made up of all the various javascript libraries/files that are used across the theme.

The javascript for the theme are all generated in a gulp task, which you can see here gulp/tasks/dev/javascript.js.

That being said, there might be a way to over-ride the player tags, and also add support for additional javascript to be called in the footer (similar to how we support additional CSS).

We could theoretically add a custom_js field to the config file (similar to the custom_css) which would point to additional javascript files from the static directory that would be included on the page load.

My biggest issue with adding this level of stuff is that it gets REALLY hard to troubleshoot; once you start injecting javascript that isn't part of the regular theme testing, I have no way of testing/confirming that javascript changes to the theme won't break some custom javascript that was added; it's also different to say "I want to add a custom CSS that overrides some classes already defined" than "here's new javascript that gets injected".

I looked a little bit more at how Podscribe's custom embed player works; it looks like they send you specific HTML block to paste in for each episode (as in, you would have to update it every time). The move might be more like "we provide the ability to turn off the player on episode pages" so then if you put in a custom player in the episode FILE you wouldn't have it duplicated.

I'd rather do that (and test it of course) than have a lot of overrides in core code. Hmm.

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

No branches or pull requests

2 participants