Update MPEG-TS detection to use HLS.js transmuxing

Changed MPEG-TS (IPTV) stream detection to use HLS.js for transmuxing instead of native playback, as browsers do not natively support MPEG-TS. Updated related tests and marked 'needsSpecialPlayer' as true. Also configured Vite to treat 'hls.js' and 'flv.js' as external dependencies.
This commit is contained in:
hibna
2025-11-04 05:43:18 +03:00
parent a7b2d84efc
commit 5555dad083
3 changed files with 15 additions and 9 deletions
+4 -3
View File
@@ -73,12 +73,13 @@ export const detectVideoProtocol = (src: string): ProtocolDetectionResult => {
// MPEG-TS (IPTV) detection
// Check for .ts extension (Transport Stream used in IPTV)
// Note: These are direct TS streams, not HLS playlists, so we use native playback
// Note: These are direct TS streams, not HLS playlists
// We use HLS.js to transmux them as browsers don't support MPEG-TS natively
if (lowerSrc.includes('.ts') || lowerSrc.match(/\.ts(\?|$)/)) {
return {
protocol: 'native', // Use native video element for direct TS streams
protocol: 'hls', // Use HLS.js which can handle MPEG-TS transmuxing
isLive: true, // IPTV streams are typically live
needsSpecialPlayer: false, // Modern browsers can handle MPEG-TS directly
needsSpecialPlayer: true, // Requires HLS.js for MPEG-TS transmuxing
}
}