We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 15001
    • 697 Posts
    Hi,

    I have to sonorize some webpage for Christmas.

    I could link to some free mp3 file on the web, but that sound file ends with something ridiculous like an advertisement.

    I’m looking for some "duration" parameter or something equivalent (some Javascript maybe) so that I can stop the mp3 sound just before that advertisement.

    The ability to loop the sound play would be a must, but I can also do without that.

    For the technical side, I’m using <object>, with an <embed> inside.

    Thanks for your help.
      • 15001
      • 697 Posts
      Switching to a "silent" sound file seems a technique to suspend a sound execution.
      See exemple 2 here : http://www.javascripter.net/faq/sound/play.htm
      A priori, this could be combined with a timer function.

      Other ideas ?
        • 28042 ☆ A M B ☆
        • 24,524 Posts
        I’ve been using Flowplayer. Very light footprint; no need for embed tags or inline javascript to mess up your XHTML validation. I use a snippet to load all the necessary .js and .css files on a page where I want Flowplayer to run, and to only load Flowplayer at all if a specified TV is set to a valid filename for the movie or whatever to play. All clip elements can have a duration property.

        http://flowplayer.org/plugins/streaming/audio.html
        http://flowplayer.org/documentation/configuration/clips.html

          Studying MODX in the desert - http://sottwell.com
          Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
          Join the Slack Community - http://modx.org