diff --git a/DOCUMENTATION.md b/DOCUMENTATION.md index 5ae8320..f317927 100644 --- a/DOCUMENTATION.md +++ b/DOCUMENTATION.md @@ -501,14 +501,13 @@ https://cdn.jsdelivr.net/npm/hls.js@1.5.13 - Media hataları → HLS instance yeniden başlatma - Fatal hataları → Error state'e düşme -#### 3. RTMP/FLV/IPTV Streaming +#### 3. RTMP/FLV Streaming **Desteklenen Protokoller:** - RTMP (rtmp://) - RTMPS (rtmps://) - RTMPT (rtmpt://) - HTTP-FLV (.flv veya flv? query) -- MPEG-TS (.ts) - IPTV streams **Kütüphane:** flv.js (opsiyonel, lazy-loaded) @@ -538,14 +537,46 @@ https://cdn.jsdelivr.net/npm/flv.js@1.6.2 // RTMP (HTTP-FLV proxy gerektirir) +``` -// IPTV (MPEG-TS) +#### 4. IPTV (MPEG-TS) Streaming + +**Desteklenen Format:** +- MPEG-TS (.ts) - Direct transport stream files + +**Kütüphane:** Yok (Native HTML5 video element) + +**Özellikler:** +- Doğrudan HTTP üzerinden TS stream oynatma +- Canlı IPTV kanalları için ideal +- Ek kütüphane gerekmez + +**Tarayıcı Desteği:** +- ⚠️ **Sınırlı destek**: Tüm tarayıcılar MPEG-TS formatını desteklemez +- ✅ **Chrome/Edge**: Genellikle destekler +- ⚠️ **Firefox**: Sınırlı destek +- ⚠️ **Safari**: Sınırlı destek +- ℹ️ **Alternatif**: M3U8 playlist üzerinden IPTV kullanımı önerilir + +**Kullanım:** +```tsx +// IPTV (MPEG-TS) - Direct stream { + console.error('IPTV stream error:', error) + // Tarayıcı MPEG-TS desteklemiyorsa kullanıcıyı bilgilendir + }} /> ``` +**ÖNEMLİ NOTLAR:** +1. **Tarayıcı Uyumluluğu**: Tüm tarayıcılar `.ts` dosyalarını doğrudan oynatamaz +2. **Alternatif Çözüm**: Mümkünse IPTV sağlayıcınızdan `.m3u8` (HLS) link isteyin +3. **CORS**: IPTV sunucusu CORS ayarlarını doğru yapılandırmalıdır +4. **Performans**: Doğrudan TS stream'ler bazı cihazlarda yavaş olabilir + **HTTP-FLV Proxy Örneği (Node.js):** ```javascript // RTMP stream'i HTTP-FLV'ye dönüştüren proxy @@ -559,7 +590,7 @@ ffmpeg('rtmp://source.com/live/stream') .pipe(res); ``` -#### 4. DASH Support (Planlanıyor) +#### 5. DASH Support (Planlanıyor) **Durum:** Protokol tespit ediliyor ancak henüz implement edilmemiş diff --git a/README.md b/README.md index 25bee64..8a5633a 100644 --- a/README.md +++ b/README.md @@ -150,9 +150,14 @@ function App() { ### IPTV Streaming ```tsx +// Note: Browser support for direct .ts streams is limited +// For best compatibility, request .m3u8 (HLS) links from your IPTV provider { + console.error('Stream error - try requesting .m3u8 format:', error) + }} /> ``` diff --git a/src/utils/videoProtocol.test.ts b/src/utils/videoProtocol.test.ts index 4124761..dceda70 100644 --- a/src/utils/videoProtocol.test.ts +++ b/src/utils/videoProtocol.test.ts @@ -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('hls') + expect(result.protocol).toBe('native') expect(result.isLive).toBe(true) - expect(result.needsSpecialPlayer).toBe(true) + expect(result.needsSpecialPlayer).toBe(false) }) it('should detect .ts files with query parameters', () => { const result = detectVideoProtocol('http://example.com/stream/video.ts?token=abc123') - expect(result.protocol).toBe('hls') + expect(result.protocol).toBe('native') expect(result.isLive).toBe(true) - expect(result.needsSpecialPlayer).toBe(true) + expect(result.needsSpecialPlayer).toBe(false) }) it('should detect HLS streams', () => { @@ -75,8 +75,8 @@ describe('videoProtocol', () => { expect(isHlsStream('http://example.com/stream.m3u8')).toBe(true) }) - it('should return true for IPTV .ts streams', () => { - expect(isHlsStream('http://favoritv65.xyz:8080/live/user/pass/98925.ts')).toBe(true) + it('should return false for IPTV .ts streams (they are native, not HLS)', () => { + expect(isHlsStream('http://favoritv65.xyz:8080/live/user/pass/98925.ts')).toBe(false) }) it('should return false for non-HLS streams', () => { diff --git a/src/utils/videoProtocol.ts b/src/utils/videoProtocol.ts index 4353af1..08765e5 100644 --- a/src/utils/videoProtocol.ts +++ b/src/utils/videoProtocol.ts @@ -73,11 +73,12 @@ 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 if (lowerSrc.includes('.ts') || lowerSrc.match(/\.ts(\?|$)/)) { return { - protocol: 'hls', // HLS player can handle MPEG-TS streams + protocol: 'native', // Use native video element for direct TS streams isLive: true, // IPTV streams are typically live - needsSpecialPlayer: true, + needsSpecialPlayer: false, // Modern browsers can handle MPEG-TS directly } }