I have a code that I want to display the duration of each song before playback.
This code works but displays the duration code after play.
my code
<?php $i=0; while ( have_rows( 'add_album_tracks' ) ) : the_row();
if(get_sub_field( 'Pre-Release' ) == 1){ ?>
echo ('null');
<?php } else { ?>
<div class="song amplitude-song-container amplitude-play-pause" data-amplitude-song-index="<?php echo($i); ?>">
<div class="song-now-playing-icon-container">
<div class="play-button-container"></div>
<div class="now-playing"><i class="fas fa-play-circle"></i></div>
</div>
<div class="song-meta-data">
<span class="song-title"><?php echo get_sub_field( 'name_of_track_separate' ) ?></span>
<span class="song-artist"></span>
</div>
<span class="song-download">
<i class="fas fa-download"></i>
</span>
<span class="song-duration">
<span class="duration">
<span class="amplitude-duration-time" amplitude-main-time-remaining="true" data-amplitude-song-index="<?php echo($i); ?>"></span>
</span>
</span>
</div>
<?php $i++; } endwhile; ?>