- Implemented. The main database-backed player now understands provider URLs from lone-embed.php style handling.

What changed:
[includes/db.php (line 
227)](/Users/tyemeclifford/Documents/GH/mediaplayer/includes/db.php:227) 
now classifies YouTube, Vimeo, Dailymotion, Twitch, Facebook, TikTok, 
Instagram, X/Twitter, SoundCloud, Spotify, Google Drive, Wistia, 
Streamable, Loom, plus direct Dropbox/GitHub media rewrites.
[index.php (line 
235)](/Users/tyemeclifford/Documents/GH/mediaplayer/index.php:235) 
renders provider URLs as iframe embeds, while uploaded/direct files 
still use Video.js.
[embed.php (line 
198)](/Users/tyemeclifford/Documents/GH/mediaplayer/embed.php:198) now 
supports those provider embeds too.
[admin/add.php (line 
260)](/Users/tyemeclifford/Documents/GH/mediaplayer/admin/add.php:260) 
and [admin/edit.php (line 
383)](/Users/tyemeclifford/Documents/GH/mediaplayer/admin/edit.php:383) 
now describe external URLs as embed-capable and store recognized 
provider URLs as text/html.
[README.md (line 
63)](/Users/tyemeclifford/Documents/GH/mediaplayer/README.md:63) 
documents provider embed support.
This commit is contained in:
Ty Clifford
2026-06-24 12:15:03 -04:00
parent b24f0dc416
commit 75d5d39cda
6 changed files with 382 additions and 30 deletions
+4 -4
View File
@@ -83,7 +83,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
$db->prepare("
INSERT INTO video_sources (video_id, label, source_type, file_path, source_url, mime_type, quality, sort_order)
VALUES (?,?,?,?,?,?,?,?)
")->execute([$video_id, $label, 'remote', '', $url, mime_from_ext($url), $quality, $sort]);
")->execute([$video_id, $label, 'remote', '', $url, source_storage_mime_from_url($url), $quality, $sort]);
$inserted_sources++;
continue;
}
@@ -259,7 +259,7 @@ render_head('Add Video — Admin', '
<div class="card">
<p class="section-heading">Video Sources</p>
<p class="hint" style="margin-bottom:1rem;">
Upload a video file or link to an external video URL. The database stores where each source lives, and the player uses that location at playback time.
Upload a video file, link a direct media file, or paste a provider page URL such as YouTube or Vimeo. The player will use a provider embed when the URL supports it.
Uploaded files: <strong>MP4, WebM, OGV, MOV, MKV, AVI</strong>. Remote URLs must use <strong>http://</strong> or <strong>https://</strong>.
</p>
@@ -270,7 +270,7 @@ render_head('Add Video — Admin', '
<label class="form-label">Source</label>
<select class="form-select source-type-select" name="source_type[]">
<option value="local" selected>Upload</option>
<option value="remote">External URL</option>
<option value="remote">External URL / Embed</option>
</select>
</div>
<div class="form-group source-location-panel source-location-local">
@@ -281,7 +281,7 @@ render_head('Add Video — Admin', '
</div>
<div class="form-group source-location-panel source-location-remote" hidden>
<label class="form-label">External URL</label>
<input class="form-input" type="url" name="source_url[]" placeholder="https://example.com/video.mp4">
<input class="form-input" type="url" name="source_url[]" placeholder="https://www.youtube.com/watch?v=...">
</div>
<div class="form-group">
<label class="form-label">Quality Label</label>