mirror of
https://github.com/R0m1k3/xtremobile.git
synced 2026-10-11 17:29:26 +02:00
feat: add IPTV player with HLS/mpegts support, loading/error UI, and parent window communication.
This commit is contained in:
1 parent
92c184ba46
commit
9dc9102d1c
1 file changed
+17
-4
+17
-4
@@ -524,11 +524,24 @@
|
||||
// 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);
|
||||
log('Detected MPEG-TS (via extension or URL)');
|
||||
|
||||
// Check if mpegts.js is supported (may not work on mobile)
|
||||
if (mpegts.isSupported()) {
|
||||
log('Using mpegts.js');
|
||||
const success = await playWithMpegTS(streamUrl);
|
||||
if (success) return;
|
||||
log('mpegts.js failed, trying fallbacks...');
|
||||
}
|
||||
|
||||
// Fallback 1: Try HLS.js for better mobile compatibility
|
||||
log('Trying HLS.js as fallback for MPEG-TS');
|
||||
const hlsSuccess = await playWithHLS(streamUrl);
|
||||
if (hlsSuccess) return;
|
||||
|
||||
// Fallback 2: Try direct play as last resort
|
||||
log('Trying direct play as last resort');
|
||||
await playDirect(streamUrl);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user