Merge pull request #80 from R0m1k3/antigravity

feat: implement web-based IPTV player with HLS.js and mpegts.js, incl…
This commit is contained in:
LogiFlow authored and GitHub committed 2025-12-07 16:08:21 +01:00
commit d2349b1405
1 file changed
+12 -9
+12 -9
View File
@@ -505,6 +505,7 @@
// Determine stream type and try appropriate player
const lowerUrl = streamUrl.toLowerCase();
const ext = urlParams.get('ext') ? urlParams.get('ext').toLowerCase() : '';
// HLS streams first
if (lowerUrl.includes('.m3u8') || lowerUrl.includes('/hls/')) {
@@ -512,6 +513,17 @@
return;
}
// MPEG-TS streams (live or forced TS via ext param)
// Checked BEFORE generic MP4/MKV to handle transcoded streams correctly
if (ext === '.ts' || lowerUrl.includes('.ts')) {
log('Detected MPEG-TS (via extension or URL), using mpegts.js');
const success = await playWithMpegTS(streamUrl);
if (!success) {
await playDirect(streamUrl);
}
return;
}
// MP4 and WebM - play directly (supports seeking via Range)
if (lowerUrl.includes('.mp4') || lowerUrl.includes('.webm') || lowerUrl.includes('.mov')) {
log('Detected MP4/WebM/MOV, playing directly with seek support');
@@ -555,15 +567,6 @@
return;
}
// MPEG-TS streams (live)
if (lowerUrl.includes('.ts')) {
const success = await playWithMpegTS(streamUrl);
if (!success) {
await playDirect(streamUrl);
}
return;
}
// Unknown format - try direct first (for VOD with Range support), then HLS
log('Unknown format, trying direct first then HLS fallback');
video.src = streamUrl;