- Fixed the thumbnail loading issue on paginated pretty URLs.

The bug was relative media paths like media/thumbs/... resolving under 
routes such as /v/<slug>?page=2 or /search/<query>?page=2. I added 
public_media_url() in 
[includes/db.php](/Users/tyemeclifford/Documents/GH/mediaplayer/includes/db.php) 
and updated public thumbnails, posters, and local player sources in 
[index.php](/Users/tyemeclifford/Documents/GH/mediaplayer/index.php), 
[catalogue.php](/Users/tyemeclifford/Documents/GH/mediaplayer/catalogue.php), 
and [embed.php](/Users/tyemeclifford/Documents/GH/mediaplayer/embed.php) 
to use root/base-aware URLs.
This commit is contained in:
Ty Clifford
2026-06-24 13:25:44 -04:00
parent 1abe5218ca
commit 7ad9c672ca
4 changed files with 12 additions and 6 deletions
+3 -3
View File
@@ -27,7 +27,7 @@ $paged = get_videos_paginated($page, $per_page);
$player_sources = [];
if ($video && !empty($video['sources'])) {
foreach ($video['sources'] as $source) {
$player_source = source_player_data($source);
$player_source = source_player_data($source, public_media_url());
if ($player_source) $player_sources[] = $player_source;
}
}
@@ -245,7 +245,7 @@ render_head('Media — TyClifford.com', '
class="video-js vjs-default-skin vjs-big-play-centered"
controls preload="metadata"
<?php if ($video['thumbnail']): ?>
poster="<?= h(MEDIA_URL . $video['thumbnail']) ?>"
poster="<?= h(public_media_url($video['thumbnail'])) ?>"
<?php endif; ?>
data-setup='{"fluid":false,"responsive":true,"playbackRates":[0.5,1,1.25,1.5,2]}'>
<?php foreach ($native_player_sources as $src): ?>
@@ -348,7 +348,7 @@ render_head('Media — TyClifford.com', '
<div class="cat-active-indicator"></div>
<div class="cat-thumb-img">
<?php if ($vthumb): ?>
<img src="<?= h(MEDIA_URL . $vthumb) ?>" alt="<?= h($vtitle) ?>" loading="lazy">
<img src="<?= h(public_media_url($vthumb)) ?>" alt="<?= h($vtitle) ?>" loading="lazy">
<?php else: ?>
<div class="no-thumb">NO THUMB</div>
<?php endif; ?>