- 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:
@@ -21,7 +21,7 @@ $base_url = $scheme . '://' . $host . $script . '/'; // e.g. https://tyclifford
|
||||
$player_sources = [];
|
||||
if ($video && !empty($video['sources'])) {
|
||||
foreach ($video['sources'] as $source) {
|
||||
$player_source = source_player_data($source, $base_url . MEDIA_URL);
|
||||
$player_source = source_player_data($source, public_absolute_url(public_media_url()));
|
||||
if ($player_source) $player_sources[] = $player_source;
|
||||
}
|
||||
}
|
||||
@@ -216,7 +216,7 @@ header('Content-Security-Policy: frame-ancestors *');
|
||||
class="video-js vjs-default-skin vjs-big-play-centered"
|
||||
controls preload="metadata"
|
||||
<?php if ($video['thumbnail']): ?>
|
||||
poster="<?= htmlspecialchars($base_url . MEDIA_URL . $video['thumbnail'], ENT_QUOTES) ?>"
|
||||
poster="<?= htmlspecialchars(public_absolute_url(public_media_url($video['thumbnail'])), ENT_QUOTES) ?>"
|
||||
<?php endif; ?>>
|
||||
<?php foreach ($native_player_sources as $src): ?>
|
||||
<source
|
||||
|
||||
Reference in New Issue
Block a user