Okay
  Public Ticket #2821661
Timestamp Jump
Closed

Comments

  • JW started the conversation

    Is there a hook similar to the external "play" button triggered by javascript that could also jump the track to a given timestamp?

    Something like...

    <button onclick="IRON.sonaar.player.setPlayerAndPlay({ id:'1234', trackid:'1', time:'65'});">Play</button>

    where "time" is the time In seconds (in this case 65 seconds into the track)? or some other way to achieve this functionality? 

  •  646
    Alexandre replied

    Hi there, 

    You can use those function to go next or previous
    IRON.sonaar.player.next()
    IRON.sonaar.player.previous()
    To jump to a specific timestamp, I need to know which waveform type you are using? Dynamic or synthetic?

    https://d.pr/i/O7nrtW

    Thanks,


    Alexandre from the Sonaar.io Crew

  • JW replied

    The plan is to use Synthetic, but knowing both options would be great!


    Thank you for the speedy reply.

  •  646
    Alexandre replied

    With the dynamic wave: IRON.sonaar.player.skip(0.5);
    With this code (0.5), we jump to the middle of the track,
    (1) to the end,
    And (0) to the begining

    And with the synthetic wave:
    document.getElementById("sonaar-audio").currentTime = 65;
    jump to 65 sec

    Thanks,


    Alexandre from the Sonaar.io Crew

  • JW replied

    Thanks! Got that part working. 

    One more question -- is there a way to pass the playlist / track ID through the synthetic wave call as well? 

    I have it working on a generic play button that passes in the playlist ID and track ID, but seems like if a different track was loaded for whatever reason (browsing the site) and I get to a page with timestamps, I'd like to find a way to pass thru the correct album / track so the timestamp is targeting the correct track in the sticky footer player.

  •  646
    Alexandre replied

    You now know how to start a a specific track to a specific time in a specific playlist. I m not sure to understand well what your are asking, but I feel I cant help more for this. 

    Thanks,


    Alexandre from the Sonaar.io Crew