This topic has 4 replies, 3 voices, and was last updated 8 years by Radu.

  • Author
  • #148566
     superminimal
    Participant

    Hi!

    How do I get the media element player to display the current time?  In the Dashboard Media Library the player displays the current time properly (mejs-currenttime) but in the theme front-end it does not.

    I also had some trouble displaying the hours in the total duration – It was only showing minutes until the file started playing.  To fix this I had to hack the core and edit wp-includes/js/mediaelement/mediaelement-and-player.min.js and change: timeFormat:”” to timeFormat:”hh:mm:ss”, but I’m sure there’s a better way!

    Thanks for your time and for a great theme!

     

    #148692
     Laura
    Moderator

    Hello, will assign the ticket to a higher support level who can help and advise you in your query.
    Thanks! ?

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    Laura Solanes - Graphic Designer and Web Designer

    Please be patient as I try to answer each topic as fast as i can.

    If you like the theme or the support you've received please consider leaving us a review on Themeforest!

    Always happy to help you 🙂

    #149073
     Radu
    Moderator

    Hi,

    There is no quick solution for that, please take a look here : http://stackoverflow.com/questions/4993097/html5-display-audio-currenttime

    Or you can use your solution but on every wp update to modify that file.

    Cheers
    R.

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution
    #149081
     superminimal
    Participant

    Hi and thanks for getting back to me.

    I was just referring to showing the current time WITHIN the media player, and the default WP media player successfully shows the current time ticking over so that’s not really the problem, it’s just that it’s missing from the Kleo version.

    If you use the built in [audio] shortcode in a post the player shows the current time (even when using the Kleo theme), but if you use the Kleo ‘media’ tab with the ‘audio’ field it doesn’t show, so it definitely seems like a theme issue.

    I have solved this by using ACF to add an ‘audio_file’ field to posts, and then in content_audio.php I’ve used the wp_audio_shortcode() function to play the audio_file with the media player (and removed the Kleo audio player code).

    https://developer.wordpress.org/reference/functions/wp_audio_shortcode/

    Also note to others: if you use the option preload=auto it will show the total duration BEFORE you press play (which is much better than showing 00:00:00 until the user presses play).

    Thanks again!

    #149291
     Radu
    Moderator

    Hi,

    Nice if you have solved and thanks you for sharing your solution with the rest of the members

    Have a nice day

    Cheers
    R.

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution
Viewing 5 posts - 1 through 5 (of 5 total)

The forum ‘Bugs & Issues’ is closed to new topics and replies.

Log in with your credentials

Forgot your details?