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

More playback choices possible? #5

Open
AlistairLethlean opened this issue Jul 28, 2020 · 4 comments
Open

More playback choices possible? #5

AlistairLethlean opened this issue Jul 28, 2020 · 4 comments

Comments

@AlistairLethlean
Copy link

Is your feature request related to a problem? Please describe.
I use media-playback-speed for my drum teaching website. I need different speeds than the ones available

Describe the solution you'd like
Instead of speeds x.5 1x 1.5x 2x I would like something like this -> x.5 x.7 x.8 x.9 1x 1.1x 1.2x 1.5x 2.

Describe alternatives you've considered
I don't code and cannot find the perfect plugin except for youtube custom speed changer. Nor know how to change your plugin if possible.

Additional context
Add any other context or screenshots about the feature request here.

@Lewiscowles1986
Copy link

Hi Alistair,

The plugin actually offers this already. It is documented (perhaps that could do with improvement). It's also documented on WordPress plugin support for this plugin.

https://wordpress.org/support/topic/can-the-available-speed-values-be-customized/

add_filter(`media-playback-speed-data`, function($data) {
    return [
        // custom speeds
    ];
});

I'd be open to a PR for improved documentation if you feel you can better document this.

@Lewiscowles1986
Copy link

Please be aware that the number of speeds you've specified, although they will work, will take up a lot of horizontal space. #4 may capture some considerations for this.

@AlistairLethlean
Copy link
Author

Hi Lewis,
Thank you for your quick reply. I have looked through your recommendations, edited the plugin and it works EXACTLY the way I want. I cannot thank you enough for help here. So many of my drum kit students will be affected by this little bit of code!

@Lewiscowles1986
Copy link

Lewiscowles1986 commented Jul 28, 2020

I have not recommended that you edit the plugin. The code I supplied is for a daughter-plugin, which someone would then be able to install aside this and still reap the benefits of the apply_filter altering the data of this plugin.

I'm glad it's working, but on a technical level, editing the main plugin, while you are free to do so, can make future upgrades more brittle as the files are overwritten on upgrade. This is fairly stable, but keeping a note that you've done it and checking before and after any upgrades might be an idea.

I'm ecstatic that this will help your students / audience though. It wasn't even the audience I primarily considered, but still those using this for music playback seem to be the most common case installers of this plugin. I made it for podcasts 😂

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