fix: use absolute media origin for playback urls

This commit is contained in:
Zhou Weidong committed 2026-11-10 17:11:23 +08:00
1 parent a105655a20
commit 441b55d25b
2 files changed
+4 -1

No files matched your search

+1 -1
View File
@@ -1,6 +1,6 @@
// Author: fruit.com.cn
const FALLBACK_IMAGE = '/assets/hero.jpg';
const MEDIA_BASE_URL = (import.meta.env.VITE_MEDIA_BASE_URL || '').replace(/\/$/, '');
const MEDIA_BASE_URL = (import.meta.env.VITE_MEDIA_BASE_URL || 'http://127.0.0.1:8081').replace(/\/$/, '');
const getText = (value, lang = 'id') => (typeof value === 'string' ? value : value?.[lang] || value?.en || value?.id || value?.zh || '');
const resolveMedia = (value) => value ? (/^https?:\/\//.test(value) ? value : `${MEDIA_BASE_URL}${value}`) : FALLBACK_IMAGE;
const getImage = (item) => resolveMedia(item.coverLandscape || item.coverUrl || item.cover || item.posterUrl || item.imageUrl);