How to change the default volume?

I would like to set the default audio volume on wordpress mediaelement.js player to 100%. The default value seems to be around 80%.

Can someone tell me which bit of code I need to change to do this?

It would be great if future versions of Wordpress had the basic β€œSettings” feature for the current native player, so we can change things like default volume and colors.

+4
source share
2 answers

Also interested in this issue. So you need to go to your folder, for example:

/ WordPress / WP-includes / JS / MediaElement /

File name:

MediaElement-and-player.min.js

Ctrl+F and do a search - startVolume

He found me 2 similar results startVolume:0.8; Perhaps for video and a second for audio. Therefore, change it from 0.8 to 1 . Then ctrl + F5 on your page, and we are done! :)

+3
source

I tried to understand this and did not want to edit the main files. Inside your theme footer.php file add:

 <!--Change Wordpress Audio Player Default Volume--> <script type="text/javascript"> jQuery(document).ready(function ($) { if($.fn.mediaelementplayer) { $("audio").mediaelementplayer({ success: function (mediaElement, domObject) { mediaElement.setVolume(1.0); } }); } }); </script> 

Just change 1.0 to what you want, between 0.1-1.0

+2
source

Source: https://habr.com/ru/post/1499882/


All Articles