Okay
  Public Ticket #2957706
Get all tracks length from the current playlist
Closed

Comments

  • Jordi started the conversation

    Hello, Is it possible to known all tracks duration from the current page playlist via Javascript API?

    We have 24 hour playlists and we need that when user click on play button playlist start at track that correspond at current time. I tried function IRON.sonaar.player.seekTime('07:00') but this method could not go to the desired track

  •  434
    Alexandre replied

    Hi Jordi, 
    We will release really soon. Maybe today but probably more monday, a new plugin version with a new feature. 
    You will be able to use a new shortcode to create time stamp.
    What you will have to do is add a shortcode like that to create a link to navigate through the whole playlist.
    [sonaar_ts track_id="2" time="10:00"]track2 at 10:00[/sonaar_ts]

    Is it what you are looking for?

    Thanks,


    Alexandre from the Sonaar.io Crew

  • Jordi replied

    Hi Alexandre, this is a great feature, but How can I get the duration of all tracks to know to which track and at what time I have to set the shortcode?

  •  434
    Alexandre replied

    Hi Jodi,

    I dont understand what you are asking. 
    You should already be able to see the time duration on the player. Is it the case? May I have your url?

    Thanks,


    Alexandre from the Sonaar.io Crew

  • Jordi replied

    My client will have playlists of 24 hours and wants that when the user makes play in some, the system detects what time it is at the moment and begins to reproduce in the point that corresponds in the playlist. 

    For example, if it is 6:14AM and the previous tracks are all 30 minutes long, the system will have to start playing at track 13 minute 14. The user plans to modify the playlist 2 to 3 times per week and as the tracks will not always last the same, I need to know how to get the duration of the tracks to be able to calculate which track to go to. 

  •  434
    Alexandre replied

    Hi Jordi,

    Ok. I understand now what you want, but this custom task is beyond our support. 
    Get the time duration is only a small part of what you have to code. 

    I can provide a js code to get the time duration of the current playing track, but this is not what you need.  

    Do you will have a player in the page content or you will only have the sticky player in the footer? I m asking this because, if a player is located in the page content, you will be able to get the time duration through the tracklist. It doesnt care if the tracklist is visible or not. It is there into the DOM. Each track in the playlist has its "data-tracktime" attribute. You can use this attribute to do what you want.

    Thanks,


    Alexandre from the Sonaar.io Crew