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:
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user