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:
hibna
2025-11-04 05:24:21 +03:00
parent e3b2d396e1
commit becc9efc7f
9 changed files with 204 additions and 4 deletions
+11 -1
View File
@@ -73,6 +73,7 @@ A feature-rich, modern video player library built with React, TypeScript, and Vi
### 🚀 Advanced Features
- **HLS Streaming** - Automatic HLS.js integration for .m3u8 files
- **IPTV Support** - MPEG-TS (.ts) streams for IPTV services
- **HTTP Range Request** - Progressive download for large MP4 files
- **Subtitles** - WebVTT and SRT support
- **Multiple Audio Tracks** - Switch between different audio streams
@@ -146,6 +147,15 @@ function App() {
/>
```
### IPTV Streaming
```tsx
<VideoPlayer
src="http://server.com:8080/live/username/password/12345.ts"
poster="http://example.com/channel-logo.png"
/>
```
### Custom Theme
```tsx
@@ -259,7 +269,7 @@ video-player/
| Prop | Type | Default | Description |
|------|------|---------|-------------|
| `src` | `string` | **required** | Video source URL (MP4, WebM, HLS) |
| `src` | `string` | **required** | Video source URL (MP4, WebM, HLS, IPTV .ts) |
| `poster` | `string` | - | Poster image URL |
| `autoplay` | `boolean` | `false` | Auto-play video on load |
| `loop` | `boolean` | `false` | Loop video playback |