Просмотр поста

.
Folour
Think different
# Fublin (06.12.2014 / 21:48)
я так понимаю это надо вставить прсто в функцию и всё ?

Ну тоест конечно присвоить там всей музыке еще и идентификатор sound чтоб звук бл тока когда есть что то новое...
полный вариант, как у меня сделано
html:
<audio id="notify" style="display: none">
  <source src="<?=DIR ?>static/sounds/notify/notify.mp3" type='audio/mpeg; codecs="mp3"'>
  <source src="<?=DIR ?>static/sounds/notify/notify.ogg" type='audio/ogg; codecs="vorbis"'>
</audio>
...
<script>
  var args = {
    ...,
    notify: document.getElementById('notify'),
    ...
  };
</script>

js:
if($('#checkbox-play-notify').is(':checked'))  args.notify.play();