Add IPTV (.ts) stream support and tests
Introduced detection and support for MPEG-TS (.ts) IPTV streams in videoProtocol, updated documentation and examples to reflect IPTV support, and added comprehensive tests for protocol detection. Mock implementations for flv.js and hls.js were added for testing, and vitest config now aliases these libraries to their mocks.
This commit is contained in:
@@ -71,6 +71,16 @@ export const detectVideoProtocol = (src: string): ProtocolDetectionResult => {
|
||||
}
|
||||
}
|
||||
|
||||
// MPEG-TS (IPTV) detection
|
||||
// Check for .ts extension (Transport Stream used in IPTV)
|
||||
if (lowerSrc.includes('.ts') || lowerSrc.match(/\.ts(\?|$)/)) {
|
||||
return {
|
||||
protocol: 'hls', // HLS player can handle MPEG-TS streams
|
||||
isLive: true, // IPTV streams are typically live
|
||||
needsSpecialPlayer: true,
|
||||
}
|
||||
}
|
||||
|
||||
// Native HTML5 video formats (MP4, WebM, OGG, etc.)
|
||||
return {
|
||||
protocol: 'native',
|
||||
|
||||
Reference in New Issue
Block a user