better handling on web player

This commit is contained in:
2026-01-01 18:23:10 +01:00
parent 6c3bc4d789
commit d09c769804
2 changed files with 22 additions and 2 deletions

View File

@@ -649,6 +649,7 @@ const AnimePlayer = (function() {
} }
if (currentExt === 'local') { if (currentExt === 'local') {
try { try {
const localId = await getLocalEntryId(); const localId = await getLocalEntryId();
if (!localId) { if (!localId) {
setLoading("Local entry not found in library."); setLoading("Local entry not found in library.");
@@ -658,11 +659,20 @@ const AnimePlayer = (function() {
const eps = await check.json(); const eps = await check.json();
if (!eps.includes(_currentEpisode)) { if (!eps.includes(_currentEpisode)) {
// 🔥 forzar online
els.extSelect.value = _entrySource; els.extSelect.value = _entrySource;
return loadStream(); return loadStream();
} }
const ext = localUrl.split('.').pop().toLowerCase();
if (!['mp4'].includes(ext)) {
setLoading(
`Currently the web player only supports mp4 files.`
);
if (els.mpvBtn) els.mpvBtn.style.display = 'flex';
return;
}
_rawVideoData = { _rawVideoData = {
url: window.location.origin + localUrl, url: window.location.origin + localUrl,
headers: {} headers: {}

View File

@@ -649,6 +649,7 @@ const AnimePlayer = (function() {
} }
if (currentExt === 'local') { if (currentExt === 'local') {
try { try {
const localId = await getLocalEntryId(); const localId = await getLocalEntryId();
if (!localId) { if (!localId) {
setLoading("Local entry not found in library."); setLoading("Local entry not found in library.");
@@ -658,11 +659,20 @@ const AnimePlayer = (function() {
const eps = await check.json(); const eps = await check.json();
if (!eps.includes(_currentEpisode)) { if (!eps.includes(_currentEpisode)) {
// 🔥 forzar online
els.extSelect.value = _entrySource; els.extSelect.value = _entrySource;
return loadStream(); return loadStream();
} }
const ext = localUrl.split('.').pop().toLowerCase();
if (!['mp4'].includes(ext)) {
setLoading(
`Currently the web player only supports mp4 files.`
);
if (els.mpvBtn) els.mpvBtn.style.display = 'flex';
return;
}
_rawVideoData = { _rawVideoData = {
url: window.location.origin + localUrl, url: window.location.origin + localUrl,
headers: {} headers: {}