Audio Player for CMSimple_XH
The includephp plugin allows CMSimple_XH users to safely include and execute PHP files directly in page content. It is designed for static includes only, executing PHP files placed in a controlled directory plugins/includephp/php/ and inserting their output into the CMS page.
0:00 / 0:00
Overview
This audio player automatically lists and plays all .mp3 and .wav files in your /userfiles/audio folder. It provides a modern interface with play, pause, next/previous, volume, and progress controls.
Features
- Automatic playlist generation (from
/userfiles/audio) - Play / Pause / Previous / Next controls
- Volume and progress sliders
- Keyboard support (Spacebar = Play/Pause)
- Mobile-friendly responsive design
- Supports
.mp3and.wav
Installation
- Copy the PHP/HTML/JS code into your CMSimple_XH page template or plugin section.
- Make sure the following folder exists:
/userfiles/audio - Upload your audio files (
.mp3or.wav) to that folder. - Reload your CMSimple_XH page – the player will automatically list all available tracks.
Configuration
- Folder location: Edit the
$dirand$webDirvariables at the top of the PHP code if your audio files are stored elsewhere. - Supported formats: Add more extensions (e.g.
.ogg) in:$files = glob($dir . '/*.{mp3,wav}', GLOB_BRACE); - Appearance: Adjust the
<style>section for colors, fonts, or layout.
Usage
- Click a track title to play it.
- Use ⏮ and ⏭ buttons to switch tracks.
- Use the slider to change volume or scrub through the track.
- Press Spacebar to toggle play/pause.
Tips
- File names such as
my_song_title.mp3appear as “My Song Title”. - Use clear, readable file names for a tidy playlist.
