- Done. The media platform now tracks sources as either local uploads or remote URLs.

Changed:
[includes/db.php (line 
43)](/Users/tyemeclifford/Documents/GH/mediaplayer/includes/db.php:43) 
adds source_type and source_url, with an automatic migration for 
existing SQLite databases.
[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 let each source be an upload or an external URL.
[index.php (line 
226)](/Users/tyemeclifford/Documents/GH/mediaplayer/index.php:226) and 
[embed.php (line 
193)](/Users/tyemeclifford/Documents/GH/mediaplayer/embed.php:193) 
resolve playback URLs based on where the source lives.
[catalogue.php (line 
79)](/Users/tyemeclifford/Documents/GH/mediaplayer/catalogue.php:79) now 
has public search for published videos only.
[README.md (line 
63)](/Users/tyemeclifford/Documents/GH/mediaplayer/README.md:63) 
documents local vs remote sources and public search.
This commit is contained in:
Ty Clifford
2026-06-24 11:58:29 -04:00
parent 7c33de810f
commit b24f0dc416
9 changed files with 392 additions and 98 deletions
+12 -2
View File
@@ -27,6 +27,9 @@ render_head('Media — TyClifford.com', '
/* ── Catalogue grid ── */
.cat-section { display:flex; flex-direction:column; gap:1rem; }
.cat-header { display:flex; align-items:center; justify-content:space-between; gap:1rem; flex-wrap:wrap; }
.cat-search { display:flex; gap:.5rem; flex:1; min-width:240px; max-width:430px; }
.cat-search input { flex:1; min-width:0; }
@media(max-width:560px) { .cat-search { min-width:100%; max-width:none; } }
.cat-grid {
display:grid;
grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
@@ -220,7 +223,7 @@ render_head('Media — TyClifford.com', '
<?php endif; ?>
data-setup='{"fluid":false,"responsive":true,"playbackRates":[0.5,1,1.25,1.5,2]}'>
<?php foreach ($video['sources'] as $src): ?>
<source src="<?= h(MEDIA_URL . $src['file_path']) ?>" type="<?= h($src['mime_type']) ?>" label="<?= h($src['quality'] ?: $src['label']) ?>">
<source src="<?= h(source_public_url($src)) ?>" type="<?= h($src['mime_type']) ?>" label="<?= h($src['quality'] ?: $src['label']) ?>">
<?php endforeach; ?>
<p class="vjs-no-js">Your browser does not support HTML video.</p>
</video>
@@ -286,6 +289,13 @@ render_head('Media — TyClifford.com', '
<section class="cat-section">
<div class="cat-header">
<p class="eyebrow eyebrow-purple">Video Catalogue</p>
<form class="cat-search" method="get" action="catalogue.php" role="search">
<input class="form-input" type="search" name="q" placeholder="Search public videos…">
<button class="btn btn-secondary btn-sm" type="submit">
<svg width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><circle cx="11" cy="11" r="8"/><line x1="21" y1="21" x2="16.65" y2="16.65"/></svg>
Search
</button>
</form>
<a href="catalogue.php" class="btn btn-secondary btn-sm">Browse all →</a>
</div>
@@ -339,7 +349,7 @@ render_head('Media — TyClifford.com', '
</span>
<?php
$url_v = $video ? '&v=' . urlencode($video['slug']) : '';
render_pagination($page, $paged['total_pages'], '?page=%d' . $url_v);
render_pagination($paged['page'], $paged['total_pages'], '?page=%d' . $url_v);
?>
</div>
<?php endif; ?>