Support » Plugin: Media Playback Speed » Can the available speed values be customized?

  • Resolved iu7489

    (@iu7489)


    Hello.

    First of all, thank you for making this useful plugin!

    Secondly, is it possible to specify which speed controls are available? For example, 0.75, 1.25, and 1.5.

    If yes, how (and where) can I change the available speed controls and remove the ones I do not want?

    Thanks,

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author LewisCowles

    (@lewiscowles)

    Hello,

    Thank you for trying it out and coming back.

    I’m pleased to say you can. There is a filter media-playback-speed-data. If you know how to write basic plugins that might be the way to go.

    Alternatively did you have a way you wanted that to work for you?

    Best,
    Lewis

    Thank you for your quick reply!

    Unfortunately, I don’t know how to write basic plugins 🙈

    Can you tell me how to write a filter that will only show 0.75, 1.25, and 1.5, please?

    Plugin Author LewisCowles

    (@lewiscowles)

    Once you’ve read and understood https://codex.wordpress.org/Writing_a_Plugin, I believe you’ll know how using the above. In case it’s not enough information, the filter you’ll want to write will receive an array containing one array per-row with name-value pairs.

    the default (plugin internal) representation right now is

    
    $defaults = array(
    		array('rate'=>0.5,'title'=>__('Playback Speed 0.5x','media-playback-speed'),'label'=>__('.5x','media-playback-speed')),
    		array('rate'=>1.0,'title'=>__('Playback Speed 1x','media-playback-speed'),'label'=>__('1x','media-playback-speed')),
    		array('rate'=>1.5,'title'=>__('Playback Speed 1.5x','media-playback-speed'),'label'=>__('1.5x','media-playback-speed')),
    		array('rate'=>2.0,'title'=>__('Playback Speed 2x','media-playback-speed'),'label'=>__('2x','media-playback-speed')),
    	);
    

    You could totally delete or change any of them.

    Plugin Author LewisCowles

    (@lewiscowles)

    I Just wanted to follow up on this. Is the help working for you?

    I am sorry for my late reply, I was ill and did not access the forums until now.

    Yes, your advice and instructions worked perfectly. Thank you!

    For the time being, I just changed the default plugin array – as a quick test and because I still need to read up on writing filters.

    But once I understand filters I will use them instead, since it is not a good idea to change default plugin files.

    Once again, thank you so much for you advice and assistance.

    Plugin Author LewisCowles

    (@lewiscowles)

    Thank you

    I’ll close this out now.

    Plugin Author LewisCowles

    (@lewiscowles)

    oh please consider rating the plugin.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Can the available speed values be customized?’ is closed to new replies.