- Implemented audio support with Video.js.

What changed:
Added uploaded/direct audio playback paths in 
[index.php](/Users/tyemeclifford/Documents/GH/mediaplayer/index.php) and 
[embed.php](/Users/tyemeclifford/Documents/GH/mediaplayer/embed.php).
Added common audio upload support: MP3, M4A, AAC, WAV, FLAC, OGG, OGA, 
OPUS.
Added waveform poster generation for uploaded audio via ffmpeg, stored 
like normal thumbnails under media/thumbs/.
Updated add/edit forms to accept media files, not just video files.
Added audio-friendly labels like Audio, 320kbps, 256kbps, 128kbps.
Updated docs and changelog.
This commit is contained in:
Ty Clifford
2026-06-25 13:34:20 -04:00
parent 8a39bc02fa
commit 7deae1a399
10 changed files with 365 additions and 80 deletions
+11 -8
View File
@@ -44,16 +44,16 @@ Styled to match the existing `gate.php` / `index.php` dark theme exactly.
│ └── layout.php ← Shared HTML head, topbar, footer, pagination
├── admin/
│ ├── index.php ← Video list with search + pagination
│ ├── add.php ← Add new video with uploaded or external URL sources
│ ├── edit.php ← Edit video metadata + manage local/remote sources
│ ├── add.php ← Add new media with uploaded or external URL sources
│ ├── edit.php ← Edit media metadata + manage local/remote sources
│ ├── youtube_import.php ← Scrape a YouTube channel and import videos
│ ├── settings.php ← Site settings, per-page count, password
│ ├── login.php ← Admin login
│ ├── logout.php ← Session destroy + redirect
│ └── auth.php ← Session auth helpers
├── media/ ← All media files (created automatically)
│ ├── videos/ ← Uploaded video files
│ └── thumbs/ ← Uploaded thumbnail images
│ ├── videos/ ← Uploaded media files
│ └── thumbs/ ← Uploaded thumbnails and generated waveforms
└── data/
└── media.db ← SQLite database (auto-created)
```
@@ -62,18 +62,19 @@ Styled to match the existing `gate.php` / `index.php` dark theme exactly.
## Usage
### Adding Videos (Admin)
### Adding Media (Admin)
1. Go to `admin/add.php`
2. Fill in title, description, duration, sort order, or paste an external URL and click **Fetch Info** to auto-fill readable metadata
3. Upload a thumbnail (JPG/PNG/WebP)
4. Add one or more video sources. Each source can be either:
- an uploaded local video file, stored under `media/videos/`
4. Add one or more media sources. Each source can be either:
- an uploaded local video or audio file, stored under `media/videos/`
- an external URL, stored in SQLite and played as a direct media source or provider embed
5. For uploaded files, supported formats include:
- **MP4** (H.264) — widest compatibility
- **WebM** (VP9) — smaller size, modern browsers
- **OGV** — Firefox fallback (legacy)
- **MP3 / M4A / AAC / WAV / FLAC / OGG / OPUS** — common audio formats
6. Set quality labels (1080p, 720p, 480p, etc.)
7. Save — Video.js will use the stored source location and auto-select the best format the browser supports
@@ -81,7 +82,7 @@ External URLs must use `http://` or `https://`. Uploaded files and remote URLs c
When adding an external URL, the admin form can fetch title, description, duration, thumbnail metadata, and readable provider view counts through oEmbed, page metadata, and JSON-LD. The save action repeats the metadata lookup as a fallback, so blank titles can be filled from supported external pages even if the browser autofill was not used.
If no thumbnail image is uploaded, the add/edit forms can auto-grab one from the first supported source. YouTube and Dailymotion use direct thumbnail URLs; Vimeo, Wistia, TikTok, SoundCloud, and Spotify use oEmbed when available. Local uploaded videos can generate a first-frame thumbnail when `ffmpeg` is installed on the server.
If no thumbnail image is uploaded, the add/edit forms can auto-grab one from the first supported source. YouTube and Dailymotion use direct thumbnail URLs; Vimeo, Wistia, TikTok, SoundCloud, and Spotify use oEmbed when available. Local uploaded videos can generate a first-frame thumbnail when `ffmpeg` is installed on the server, and local uploaded audio can generate a waveform poster image.
### Live Homepage Option
@@ -142,6 +143,8 @@ Use the **Sort Order** field — lower numbers appear first. Default is 0. The *
- Playback rate controls: 0.5×, 1×, 1.25×, 1.5×, 2×
- Multiple source fallback — browser picks best format automatically
- Local uploaded sources and remote URL sources
- Audio playback for uploaded or direct linked audio sources
- Generated waveform poster images for uploaded audio when `ffmpeg` is available
- Provider embeds for popular video and audio platforms
- Thumbnail posters
- Per-video view counts and optional public library statistics