Comprehensive Vue 3 streaming library with composables for WebSocket, Socket.IO, HLS, Laravel Echo, WebRTC, Point Cloud, and Data Streaming.
npm install vue-streaming
Comprehensive Vue 3 streaming library with composables for WebSocket, Socket.IO, HLS, Laravel Echo, WebRTC, Point Cloud, and Data Streaming.
---
- useWebSocket - Native WebSocket with auto-reconnect and heartbeat
- useSocketIO - Full Socket.IO support with rooms and events
- useHLS - HTTP Live Streaming with quality control
- useLaravelEcho - Pusher/Reverb broadcasting integration
- useWebRTC - Peer connections with data channels for point cloud/detection
- usePointCloud - LiDAR/3D point cloud streaming and decoding
- useDataStream - Generic data streaming with buffering and deduplication
- Components - StreamViewer, HLSPlayer, PointCloudViewer, WebRTCViewer
- TypeScript - Full TypeScript support with exported types
- Tree-shakeable - Import only what you need
---
bash
npm install vue-streaming
yarn add vue-streaming
pnpm add vue-streaming
Install based on the features you need:
bash
npm install hls.js
npm install socket.io-client
npm install laravel-echo pusher-js
npm install three @types/three
npm install draco3d
---
vue
vue
vue
vue
vue
vue
vue
---
Generic stream viewer for displaying real-time data:
vue
:max-lines="100"
:auto-scroll="true"
:show-timestamps="true"
/>
HLS video player with quality controls:
vue
:auto-play="true"
:controls="true"
:low-latency="true"
@ready="onReady"
@level-change="onQualityChange"
/>
3D point cloud visualization (requires three.js):
vue
:point-size="0.02"
:auto-rotate="true"
:show-grid="true"
/>
WebRTC stream viewer with connection controls:
vue
:enable-point-cloud="true"
:enable-detections="true"
:auto-connect="true"
@pointcloud="onPointCloud"
@detections="onDetections"
/>
---
| Option | Type | Default | Description |
| ---------------------- | -------------------- | -------- | ---------------------------- |
| url | string | required | WebSocket URL |
| protocols | string \| string[] | - | Subprotocols |
| autoConnect | boolean | true | Auto-connect on mount |
| autoReconnect | boolean | true | Auto-reconnect on disconnect |
| maxReconnectAttempts | number | 5 | Max reconnection attempts |
| reconnectDelay | number | 1000 | Initial reconnect delay (ms) |
| heartbeatInterval | number | - | Heartbeat interval (ms) |
| Option | Type | Default | Description |
| ------------- | --------- | -------- | ------------------------ |
| url | string | required | Server URL |
| options | object | - | Socket.IO client options |
| autoConnect | boolean | true | Auto-connect on mount |
| Option | Type | Default | Description |
| ---------------- | --------- | -------- | ----------------------------- |
| url | string | required | HLS manifest URL |
| autoPlay | boolean | true | Auto-play on attach |
| lowLatencyMode | boolean | false | Enable low-latency mode |
| startLevel | number | -1 | Initial quality (-1 for auto) |
| Option | Type | Default | Description |
| ------------- | ------------------------------------- | -------- | ---------------- |
| broadcaster | 'pusher' \| 'socket.io' \| 'reverb' | required | Broadcaster type |
| key | string | - | Pusher app key |
| cluster | string | - | Pusher cluster |
| wsHost | string | - | WebSocket host |
| wsPort | number | - | WebSocket port |
| Option | Type | Default | Description |
| ------------------ | ---------------- | -------- | -------------------------- |
| signalingUrl | string | required | Signaling server URL |
| iceServers | RTCIceServer[] | STUN | ICE servers |
| enablePointCloud | boolean | true | Enable point cloud channel |
| enableDetections | boolean | true | Enable detection channel |
| Option | Type | Default | Description |
| ------------------ | ------------------ | -------- | --------------------- |
| format | PointCloudFormat | 'auto' | Point cloud format |
| maxPoints | number | - | Max points to decode |
| downsampleFactor | number | 1 | Downsample factor |
| dracoPath | string | - | Path to DRACO decoder |
| Option | Type | Default | Description |
| ------------- | --------- | ------- | ------------------------ |
| bufferSize | number | 1000 | Max buffer size |
| throttleMs | number | - | Throttle interval |
| deduplicate | boolean | false | Enable deduplication |
| batchSize | number | - | Batch size for callbacks |
---
The package still exports the legacy StreamPlayer component for backward compatibility:
vue
:config="{ url: 'wss://example.com' }"
:auto-open="true"
/>
---
MIT (c) Kerolos Zakaria