Okay
  Public Ticket #3562167
New Feature Request
Closed

Comments

  • Matt started the conversation

    I don't know if a Ticket is the right place for this, but...

    We've had some listeners suggest a new feature that we hadn't considered: A time-out feature.

    Specifically, some of our listeners say they like to put on some of our longer playlists before bed, and like to fall asleep to them. They've asked for a way for the playlist to eventually stop, so it doesn't run all night or wake them up once they fall asleep.

    Big ask, I know, but maybe somebody else out there would use it. The more I think about it, the less I'm certain how best to accomplish this... I mean, a pop-up prompt asking if they're still listening that starts a count-down that stops the player if it reaches zero? That's what I've seen on TVs after so many hours, for example, to save energy. They'll turn themselves off if you don't click the resume button. But if you have to get out of bed to click something, then it's hardly convenient. I dunno... thought I'd ask if you had any suggestions or ideas. There have to be some people using your software who do sleep-aid (white noise, nature sounds, etc) audio on their websites. Maybe they'd be into this idea also and have some additional input.

  •  1,103
    Max replied

    Hi,

    this would require a bit of custom javascript.

    You can add this and it should works. however, I have not tested the script much so it might needs adjustment. The timer will reset when it reach 60 minutes, everytime a new track start. so the track must be more than 60 minutes in this case.


    var timerDuration = 3600000; // This is equivalent to 60 minutes, its in milliseconds
    var myAudio = document.getElementById('sonaar-audio');
    function stopAudio() {
        myAudio.pause(); // Pauses the audio
        myAudio.currentTime = 0; // Resets the audio to the beginning
    }
    function startTimer() {
        setTimeout(stopAudio, timerDuration);
    }
    // Event listener for the play event
    myAudio.addEventListener('play', startTimer);
    


    Thanks,


    Max from the Sonaar.io Crew

  • Matt replied

    Would it be possible to do this per-playlist, rather than per-track?

  •  1,103
    Max replied

    If other users request for this feature, we will add it to our roadmap but you're the first user requesting this.

    This would require more customizing in the case you want it for per-playlist. Unfortunately, providing custom code is beyond the scope of our free support. If you are interested, we offer a customization service available here: https://sonaar.io/service/website-customization-service/


    Thanks,


    Max from the Sonaar.io Crew

  • Matt replied

    Thank you for your per-track custom code suggestion, and even taking the time to consider working the problem. As this is the first request for this feature from our listeners, I doubt we'll be able to justify going through with additional custom development requests. But, once again Max, you impress with your willingness to listen to your users and consider our needs. So quick with that reply too! It's greatly appreciated.

    You may close this ticket. :) Thanks again!


  •  1,103
    Max replied

    You are welcome

    Thanks,


    Max from the Sonaar.io Crew