mirror of
https://github.com/R0m1k3/xtremobile.git
synced 2026-10-11 17:29:26 +02:00
Merge pull request #33 from R0m1k3/antigravity
feat: add IPTV player with HLS and MPEG-TS support
This commit is contained in:
commit
dc337b42e4
1 file changed
+17
-4
+17
-4
@@ -249,15 +249,28 @@
|
|||||||
log('Stream URL: ' + streamUrl.substring(0, 80) + '...');
|
log('Stream URL: ' + streamUrl.substring(0, 80) + '...');
|
||||||
|
|
||||||
// Determine stream type and try appropriate player
|
// Determine stream type and try appropriate player
|
||||||
if (streamUrl.includes('.m3u8')) {
|
const lowerUrl = streamUrl.toLowerCase();
|
||||||
|
|
||||||
|
// Check for standard video files that should be played directly
|
||||||
|
if (lowerUrl.includes('.mp4') || lowerUrl.includes('.mkv') ||
|
||||||
|
lowerUrl.includes('.avi') || lowerUrl.includes('.webm') ||
|
||||||
|
lowerUrl.includes('.mov')) {
|
||||||
|
log('Detected direct video file, playing directly');
|
||||||
|
await playDirect(streamUrl);
|
||||||
|
}
|
||||||
|
// HLS streams
|
||||||
|
else if (lowerUrl.includes('.m3u8')) {
|
||||||
await playWithHLS(streamUrl);
|
await playWithHLS(streamUrl);
|
||||||
} else if (streamUrl.includes('.ts')) {
|
}
|
||||||
|
// MPEG-TS streams
|
||||||
|
else if (lowerUrl.includes('.ts')) {
|
||||||
const success = await playWithMpegTS(streamUrl);
|
const success = await playWithMpegTS(streamUrl);
|
||||||
if (!success) {
|
if (!success) {
|
||||||
await playDirect(streamUrl);
|
await playDirect(streamUrl);
|
||||||
}
|
}
|
||||||
} else {
|
}
|
||||||
// Try HLS first, then MPEG-TS
|
// Unknown format - try HLS first (for FFmpeg generated streams)
|
||||||
|
else {
|
||||||
await playWithHLS(streamUrl);
|
await playWithHLS(streamUrl);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user