Add MPEG-TS support and related utilities

Introduces MPEG-TS streaming support by adding mpegts.js as an optional dependency, updating keywords, and implementing new utility modules for MPEG-TS loading and setup. Updates VideoElement and videoProtocol logic to handle MPEG-TS streams, adds corresponding tests and mocks, and improves local settings for npm install.
This commit is contained in:
hibna
2025-11-04 06:36:21 +03:00
parent db2e3a0722
commit b0e278afb5
10 changed files with 380 additions and 3594 deletions
+5 -5
View File
@@ -5,16 +5,16 @@ describe('videoProtocol', () => {
describe('detectVideoProtocol', () => {
it('should detect MPEG-TS IPTV streams', () => {
const result = detectVideoProtocol('http://favoritv65.xyz:8080/live/Apollon45/HpjWrDa6gWWd/98925.ts')
expect(result.protocol).toBe('native')
expect(result.protocol).toBe('mpegts')
expect(result.isLive).toBe(true)
expect(result.needsSpecialPlayer).toBe(false)
expect(result.needsSpecialPlayer).toBe(true)
})
it('should detect .ts files with query parameters', () => {
const result = detectVideoProtocol('http://example.com/stream/video.ts?token=abc123')
expect(result.protocol).toBe('native')
expect(result.protocol).toBe('mpegts')
expect(result.isLive).toBe(true)
expect(result.needsSpecialPlayer).toBe(false)
expect(result.needsSpecialPlayer).toBe(true)
})
it('should detect HLS streams', () => {
@@ -75,7 +75,7 @@ describe('videoProtocol', () => {
expect(isHlsStream('http://example.com/stream.m3u8')).toBe(true)
})
it('should return false for IPTV .ts streams (they use native playback)', () => {
it('should return false for IPTV .ts streams (they use mpegts.js)', () => {
expect(isHlsStream('http://favoritv65.xyz:8080/live/user/pass/98925.ts')).toBe(false)
})