# j-Audio

> j-Audio: singleton; the component can play and stop audio/sound mp3

Framework: jcomponent20
Product: jComponent 20 (jcomponent@20)
Language: en
Content-SHA256: 581947923f6c15cbdb76624cf7cc6ec18080d483b8ef315a4eef3833a630991a
Snapshot: c0700e321579725c5cf4f5ace1ad7d2866d1b4f93c24a63c0b41b6b7998e976c
Sources: components@910ed1a86f6e72b4f031d3ad0dc7844f9fc5cb8e
Review: not-recorded

- 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.

```html 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>
```
