Okay
  Public Ticket #2632091
Enable Track time in shortcode
Closed

Comments

  • Davidson J Ospina started the conversation

    Hi Guys,

    Got this working so far using my own CSS without Elementor. Yes, Yes, I know it's great & I can turn & off the Track Time! But when I hand off this project, I assure you this client will not have a clue how to use that builder even after a full tutorial. So kept it nice & simple! using just Advanced Custom Fields. 

    Is there a way to enable to show the Track time in the shortcode?? 

    Here is what I have working perfectly! 

    <?php echo do_shortcode('[sonaar_audioplayer playlist_type="feed" playlist_title="'.get_field('artist_title').'" artwork_id="" feed="'.get_field('upload_mp3_file').'" feed_title="'.get_field('song_title').'" feed_img="'.get_field('cover_image').'" hide_artwork="false" show_playlist="true" hide_timeline="true" scrollbar="false" shuffle="false" sticky_player="true"][/sonaar_audioplayer]'); ?>


  •  1,103
    Max replied

    Hi there,

    Great job using ACF here.

    The issue with external MP3s (that are not uploaded via WP media library), is that your PHP server must have id3 extension library enabled and not all servers got this extension enabled by default. That can leads to a lot of support questions, especially for non-techsavyy people.

    And using the built-in WP ID3 tag manager, WP only support local file as well. So we are a bit screwed here.

    Im sorry



    Thanks,


    Max from the Sonaar.io Crew

  • Davidson J Ospina replied

    Hi Max,

    Ah! the good old id3 Extension library. Totally forget about that one. Makes sense.
    In any case, Perfect response! Now I know what to do  if I continue using this method.

    Thank you
    Davidson

  •  1,103
    Max replied

    Even if the extension is activated on your server, our script is made to not provide the length for the reason mentioned before.

    You will have to develop your own script for this

    Thanks,


    Max from the Sonaar.io Crew

  • Davidson J Ospina replied

    Hey Max,

    Thanks

    Is there a way to have the Artist Name come up also in the Short code?? 

    Is this because i'm not adding a post id ? 

  •  1,103
    Max replied

    Hi,

    Unfortunately its not possible because you are using the feed attribute. Artist names are also a value that is being pull from the ID3 tag.


    Thanks,


    Max from the Sonaar.io Crew

  • Davidson J Ospina replied

    Hi Max,

    Losing my mind man! I know I'm so close, but I can not get that damn duration (Length) to show on the page.

        require_once( ABSPATH . '/wp-admin/includes/media.php' );
        $file = get_field('upload_mp3_file');
        $metadata = wp_read_audio_metadata( $file ) ;
        print "Audio is " . $metadata['length'] . ' seconds long';

    Any suggestions? 


  •  1,103
    Max replied

    You are using the wordpress meta data function but you are using an external media file which is not being uploaded into WordPress so it wont work. You cannot use the wp_read_audio_metadata if the file have not been uploaded via WP


    Thanks,


    Max from the Sonaar.io Crew

  • Davidson J Ospina replied

    Hi Max,

    That's just it -  I did uploaded the file via ACF upload which uploads to the media directory. Am I missing something? 

  •  1,103
    Max replied

    Unfortunately, this is a bit beyond the scope of our support. If you would like us to assist into customizing the player to suits your needs, we have a service we offer here: https://sonaar.io/service/website-customization-service/ otherwise, you will need to check with a WordPress developer.


    Thanks,


    Max from the Sonaar.io Crew

  • Davidson J Ospina replied

    Ok Thank you! Will consider this.