Skip to main content

Smart Background Sound

Set the mood. Keep it tasteful.
Latest Version
0.9.21
Requires
YOOtheme Pro 5+, Joomla 5+, WordPress 6.5+, PHP 8.1 or newer
Release date
02 November 2026
Made for
YOOtheme Pro, Joomla, WordPress
License
GPL-2.0-or-later
Price
Free
Tasteful ambient sound with a smart mute. Used responsibly, we promise.

What's new in version 0.9.21

  • Changed: Installing adds mp3, ogg, wav and m4a to the upload settings that Joomla 5 and 6 actually read (Allowed Extensions, Audio Extensions and the MIME types). An empty setting stays empty, so the Joomla default keeps applying. Updates no longer touch the Media settings, so a choice made there stays as it is.
  • Changed: The Enabled setting no longer removes the element from the Builder. While it is off, the element stays in your layouts but shows nothing and loads no files, so a page saved in the meantime keeps its music element.
  • Changed: The element has the standard Advanced tab (name, status, ID, class, attributes, margin and visibility), like YOOtheme's own elements.
  • Changed: The update site is now called "Smart Background Sound Updates"; existing sites get the new name with this update.
  • Changed: Stylesheet and script load through the Joomla Web Asset Manager.
  • Changed: Contact address in the package is This email address is being protected from spambots. You need JavaScript enabled to view it..
  • Fixed: Variant 4 ("off, this section") now really starts silent. When the section comes into view only the button appears; the music plays only after the visitor turns it on, and that choice is remembered for the next visit. Until 0.9.20 the music could start with sound after any click on the page, such as on a cookie banner.
  • Fixed: A muted or silent video (a background video, a slider video) no longer lowers the music. A video that is muted while playing releases the music again.
  • Fixed: The music no longer stays lowered for the rest of the visit when a video or player is removed from the page without stopping first, for example when a lightbox closes.
  • Fixed: With "Duck for other media" off, switching browser tabs pauses the music again, and only one music element plays at a time.
  • Fixed: An audio file that fails to load right away (for example a missing file) now shows the "unavailable" button instead of a button that does nothing.
  • Fixed: A field that holds a list or object instead of text (damaged or hand-edited layout) no longer breaks the page.
  • Fixed: An emptied Volume, X distance or Y distance field uses the default value instead of 0.
  • Fixed: The first-visit hint is on by default for elements saved before 0.9.13, like the other on/off settings.
  • Fixed: An internal Joomla link as audio source is no longer escaped twice.
Smart Background Sound 1

    Description

    Smart Background Sound is a free audio element for YOOtheme Pro. Drop it on a page, pick an audio file (MP3, OGG, WAV or M4A) and your page gets a soft layer of sound with a small button to switch it on and off.

    By default it starts silent. The music plays only after the visitor turns it on, and that choice is remembered for the next visit. If you would rather start with sound, there is a variant for that: it tries to play and shows the button whenever the browser blocks it.

    Play it across the whole page, or tie it to one section so the music pauses when that section scrolls out of view.

    It knows when to step back. When a video or another player on the page starts, the music lowers itself and comes back afterwards. That works for HTML5 audio and video, YouTube, Vimeo and Spotify. A muted background video does not count.

    You set the volume, whether the track loops, and where the button sits. If the audio file cannot be loaded, visitors see an "unavailable" button instead of one that does nothing.

    The same element on Joomla and on WordPress, and it is free.

    Is there an audio element for YOOtheme Pro?

    Yes. Smart Background Sound adds one to the builder. It plays a single audio file as background sound, with a button for the visitor.

    Does it autoplay?

    Not by default. The element starts silent and plays after the visitor switches it on. You can pick a variant that tries to start with sound, browsers often block that, and then the button appears instead.

    Which audio files can I use?

    MP3, OGG, WAV and M4A. On Joomla the installer adds these types to the upload settings of the Media Manager.

    Is it an audio player with a playlist?

    No. It plays one track as background sound. For a list of audio clips, podcasts or Spotify embeds that play one at a time, look at Smart Grid.

    Feature request

    What is the next feature for this plugin?

    Submit your idea or vote on existing ones.


      Changelog


      v0.9.21
      Changed
      • Installing adds mp3, ogg, wav and m4a to the upload settings that Joomla 5 and 6 actually read (Allowed Extensions, Audio Extensions and the MIME types). An empty setting stays empty, so the Joomla default keeps applying. Updates no longer touch the Media settings, so a choice made there stays as it is.
      • The Enabled setting no longer removes the element from the Builder. While it is off, the element stays in your layouts but shows nothing and loads no files, so a page saved in the meantime keeps its music element.
      • The element has the standard Advanced tab (name, status, ID, class, attributes, margin and visibility), like YOOtheme's own elements.
      • The update site is now called "Smart Background Sound Updates"; existing sites get the new name with this update.
      • Stylesheet and script load through the Joomla Web Asset Manager.
      • Contact address in the package is This email address is being protected from spambots. You need JavaScript enabled to view it..
      Fixed
      • Variant 4 ("off, this section") now really starts silent. When the section comes into view only the button appears; the music plays only after the visitor turns it on, and that choice is remembered for the next visit. Until 0.9.20 the music could start with sound after any click on the page, such as on a cookie banner.
      • A muted or silent video (a background video, a slider video) no longer lowers the music. A video that is muted while playing releases the music again.
      • The music no longer stays lowered for the rest of the visit when a video or player is removed from the page without stopping first, for example when a lightbox closes.
      • With "Duck for other media" off, switching browser tabs pauses the music again, and only one music element plays at a time.
      • An audio file that fails to load right away (for example a missing file) now shows the "unavailable" button instead of a button that does nothing.
      • A field that holds a list or object instead of text (damaged or hand-edited layout) no longer breaks the page.
      • An emptied Volume, X distance or Y distance field uses the default value instead of 0.
      • The first-visit hint is on by default for elements saved before 0.9.13, like the other on/off settings.
      • An internal Joomla link as audio source is no longer escaped twice.
      v0.9.20
      Added
      • The Status field on the plugin settings page shows the measured state: working, switched off with the Enabled setting, YOOtheme Pro not found, or element files missing. It used to show a fixed text.
      • Install and update read back whether the plugin was enabled. If it was not, a warning explains where to enable it, and the reason is written to the Joomla log.
      Changed
      • LICENSE.txt now contains the full text of the GNU General Public License version 2. The trademark notice moved from LICENSE.txt to NOTICE.txt.
      • Copyright lines no longer say "All rights reserved", which read as a contradiction of the GPL.
      • Builder icon in the colour of this product (red instead of purple) and at the 30 and 20 px sizes YOOtheme uses in the element picker.
      • The release package no longer contains development tooling (check scripts, linter and analyser configuration, composer.json, package.json). None of these files were installed on the site, so nothing changes there.
      • Help texts for loop, volume, size, anchor, unit, X and Y distance, entrance animation, theme and label now state the default value, in all six languages. The Enabled setting explains what switching it off does to the Builder and to pages.
      v0.9.19
      Added
      • NOTICE.txt: data processing section (client-side localStorage for the
      • Release tooling: the forbidden-licence-text check in
      Changed
      • No functional change; the runtime behaviour, the element configuration
      Fixed
      • NOTICE.txt: removed a leftover pre-GPL restricted-distribution line
      v0.9.18
      Changed
      • Licensing moved to GPL-2.0-or-later, in line with the YOOzeCase licensing decision of 2 August 2026. The manifest now declares `GNU General Public License version 2 or later`, `LICENSE.txt` carries the full GPL text, and `COPYRIGHT.txt` and `NOTICE.txt` no longer describe the software as proprietary. Every PHP, JS and CSS file carries the GPL header instead of the previous restricted-access notice.
      • This changelog is now in English throughout. Roughly 90 entries from 0.2.5 up to 0.9.15 were written in Dutch while the product pages, the README and the plugin itself are English. Code identifiers, file names, language keys and version numbers are unchanged.
      • Release tooling refreshed to the current YOOzeCase standard: `scripts/pre-release-grep-check.sh`, `scripts/selftest-grep-check.sh` and `scripts/check-php-matrix.sh` now check for the GPL header rather than requiring the old notice.
      • No functional change. Nothing in the runtime behaviour, the element configuration or the stored settings is affected by this release.
      • What you buy remains a subscription to downloads, updates and support. The GPL covers the source code; it does not cover the YOOzeCase name, branding, product images or documentation.
      Removed
      • `TERMS.txt` is no longer part of the package. The commercial terms live at https://www.yoozecase.com/terms; the licence that travels with the code is the GPL.
      v0.9.17
      Fixed
      • Degraded state is now final: when an audio source fails, late
      v0.9.16
      Added
      • Audio error handling: when the configured audio source fails to load
      • Mixed-content guard: an http:// audio URL on an https site is upgraded
      • Update-server feeds: updates.xml and changelog.xml are now delivered
      Fixed
      • The plugin config switch "Enabled" now actually disables the plugin:
      Security
      • validateAudioUrl strips control characters (0x00-0x1F, 0x7F) before
      • AI warning header harmonised to the canonical text (including the
      v0.9.15
      Added
      • External audio URL as a validated source: besides a local file, the "Audio file" field now explicitly accepts a direct external audio URL (CDN or your own host). Client-side `<audio>`, no server fetch (no SSRF). New README section "External audio URL" covering the points to watch (HTTPS/mixed content, hotlinking, Content-Type, no YouTube/Spotify because of their terms of service).
      Changed
      • `resolveAudioUrl` in template.php now validates every URL against a scheme whitelist: `http(s)://`, protocol-relative (`//`), root-relative (`/`) and Joomla routes (`index.php?...`) are allowed; dangerous or non-audio schemes (`javascript:`, `data:`, `vbscript:`, `file:`) are rejected, after which the element falls back cleanly to the degraded button instead of emitting a malformed `src`. Previously every string was passed through unchecked.
      v0.9.14
      Fixed
      • Visibility pause did not really mute a background tab: since the fade landed (v0.9.6), muting ran through `requestAnimationFrame`, which browsers freeze in a hidden tab, so `audio.muted = true` (set only in the fade completion) was never reached and the music kept playing at full volume for as long as the tab sat in the background. The tab-hidden branch now sets `audio.muted = true` synchronously, independently of the fade (functional audit, item 1).
      • Variant 1 (always on) did not show the activation coachmark when the browser blocked autoplay, while variants 2/3/4 do. Variant 1 now has the same 800ms fallback that still shows the coachmark if the button drops to the off state (functional audit, item 2).
      v0.9.13
      Added
      • Activation coachmark: a one-time, self-dismissing hint next to the button on a first visit (in the off state only), inviting the visitor to start the music. The text comes from the language layer (`_COACHMARK`, 6 languages) and is remembered site-wide in localStorage (`yc_sbs_coach_seen`) so it does not repeat on every page. New element field "First-visit hint" (Behaviour tab, on by default). Raises activation for the off-by-default variants (improvement audit, item 1).
      • Optional event hook: `yc-music:play` and `yc-music:pause` are dispatched as DOM CustomEvents on the element so the site owner can wire up GA4/Matomo themselves. The plugin sends no data of its own. New element field "Emit JS events" (Behaviour tab, off by default) - privacy-clean and provider-independent (improvement audit, item 3).
      Changed
      • Play/pause affordance: the music note icon morphs into two pause bars via CSS while playing, making it clearer that a second click mutes. Respects `prefers-reduced-motion` (improvement audit, item 1).
      • Follow-up to the improvement audit of v0.9.12 (audit_plg_system_yc_smart_background_sound_v0.9.12.md). No security impact; the event hook is opt-in and sends no data to third parties. Language key parity 99 keys x 6 languages.
      Fixed
      • End state with loop=off: when a non-repeating track finishes naturally, the plugin now returns the button to the off state (icon, `aria-pressed`, label), so a single click starts it again. Previously the button stayed visually stuck in the playing state (improvement audit, item 5).
      v0.9.12
      Changed
      • Preflight PHP version message (`script.php`): the hardcoded Dutch text has been replaced by a neutral English literal with an explanation. Deliberately no language layer: preflight runs before the package files (including the language files) are copied, so a Text key would render raw at that point (software audit, item 2; edge case, Joomla 5 already requires PHP 8.1+).
      • `update()` in `script.php`: `@unlink()` replaced by `Joomla\Filesystem\File::delete()` inside a try/catch, consistent with `cleanupLegacyFiles()`.
      • Version sync to 0.9.12 via `tools/bump-version.sh`.
      • Follow-up to the software audit of v0.9.11 (audit_plg_system_yc_smart_background_sound_v0.9.11.md). No security impact; no functional change for visitors.
      Removed
      • Diagnostic DOM attributes `data-yc-music-raw-type` and `data-yc-music-raw-value` from `template.php` (plus the `$debugType`/`$debugRaw` build-up). They were emitted on every render but never read by the JS (dead debug output) and leaked the internal audio field structure into the public DOM (software audit, item 1; skill 10.4/6.3).
      • Unused `public $app` property from the main plugin class.