Web Component: j-Sounds


  • Info
  • HTML
  • JS
  • CSS
  • Meta

j-Sounds

This component contains some predefined sounds like beep, fail, success, etc... Path contains a volume control in percentage, 0 disables playing.

Configuration:

  • url {String} URL address to sound library (default: https://cdn.componentator.com/sounds/)
  • volume {Number} (default: 50)

Good to know:

path can contain {Number}, which will control volume or {Boolean} which will enable or disable sounds.

Methods:

  • component.play(sound) supported sounds:
    • alert
    • message
    • badges
    • notifications
    • beep
    • confirm
    • done
    • drum
    • fail
    • success
  • component.success()
  • component.fail()
  • component.alert(), component.error()
  • component.warning()
  • component.notify()
  • component.badge()
  • component.confirm()
  • component.beep()
  • component.drum()

Author