ForgeComponents
en

Components

j-Audio

jComponent 20 · jcomponent@20 component Example loaded with jComponent 20
  • singleton
  • the component can play and stop audio/sound mp3
  • path represents a volume control

Methods:

  • component.play(url) can play audio/sound from URL
  • component.stop(url) can stop audio/sound

Properties:

  • component.items contains all audio objects

Use it with <ui-component name="audio">. When the component is not loaded yet, jComponent downloads it on first use from the address in DEF.fallback (the Componentator CDN by default). Author: Peter Širka. Source: the Componentator components repository, MIT license.

example.html
<ui-component name="audio" path="volume"></ui-component>

<script>
	var volume = 50; // 50%
	if (jComponent.is20)
		SETTER('audio/play @important', 'https://www.soundhelix.com/examples/mp3/SoundHelix-Song-1.mp3');
	else
		SETTER(true, 'audio/play', 'https://www.soundhelix.com/examples/mp3/SoundHelix-Song-1.mp3');
</script>