rvms-vue 0.1.5 → 0.1.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +72 -13
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # rvms-vue
2
2
 
3
- Vue 3 components for **RVMS (Video-MS)** — video player with MSE streaming and alarm panel.
3
+ Vue 3 components for **RVMS (Video-MS)** — video player with MSE streaming, live and playback modes, and optional alarm panel.
4
4
 
5
5
  ## Install
6
6
 
@@ -8,7 +8,7 @@ Vue 3 components for **RVMS (Video-MS)** — video player with MSE streaming and
8
8
  npm install rvms-vue
9
9
  ```
10
10
 
11
- ## Usage
11
+ ## Live stream
12
12
 
13
13
  ```vue
14
14
  <script setup>
@@ -17,28 +17,87 @@ import { RvmsVideoPlayer } from 'rvms-vue';
17
17
 
18
18
  <template>
19
19
  <RvmsVideoPlayer
20
- nvr-id="your-nvr-id"
21
- device-id="101"
20
+ nvr-id="a1b2c3d4-..."
21
+ device-id="201"
22
22
  :show-alarms="true"
23
23
  />
24
24
  </template>
25
25
  ```
26
26
 
27
+ ## Playback
28
+
29
+ ```vue
30
+ <script setup>
31
+ import { ref } from 'vue';
32
+ import { RvmsVideoPlayer } from 'rvms-vue';
33
+
34
+ const player = ref(null);
35
+ const from = '2025-01-15T10:00:00Z';
36
+ const to = '2025-01-15T11:00:00Z';
37
+
38
+ function playRecording() {
39
+ player.value?.start();
40
+ }
41
+ </script>
42
+
43
+ <template>
44
+ <RvmsVideoPlayer
45
+ ref="player"
46
+ nvr-id="a1b2c3d4-..."
47
+ device-id="201"
48
+ mode="playback"
49
+ :from="from"
50
+ :to="to"
51
+ />
52
+ <button @click="playRecording">▶ Play recording</button>
53
+ </template>
54
+ ```
55
+
56
+ ## Simple player (no alarms)
57
+
58
+ ```vue
59
+ <script setup>
60
+ import { RvmsVideo } from 'rvms-vue';
61
+ </script>
62
+
63
+ <template>
64
+ <RvmsVideo
65
+ nvr-id="a1b2c3d4-..."
66
+ channel-id="201"
67
+ width="100%"
68
+ height="480px"
69
+ />
70
+ </template>
71
+ ```
72
+
27
73
  ## Components
28
74
 
29
75
  ### `RvmsVideoPlayer`
30
76
 
31
- Full-featured video player with:
32
- - H.264 / HEVC + audio codec auto-detection
33
- - MSE (Media Source Extensions) streaming via WebSocket proxy
34
- - Live and playback modes
35
- - Alarm notification overlay
36
- - Profile switching (main / sub / third)
77
+ Full-featured player with alarm overlay. Supports live and playback. Exposes `start()` / `stop()` via template ref.
78
+
79
+ | Prop | Type | Default | Description |
80
+ |------|------|---------|-------------|
81
+ | `nvrId` | `string` | required | NVR UUID |
82
+ | `deviceId` | `string` | required | Device/channel id |
83
+ | `mode` | `'live' \| 'playback'` | `'live'` | Stream mode |
84
+ | `from` | `string` | — | ISO 8601 start (playback only) |
85
+ | `to` | `string` | — | ISO 8601 end (playback only) |
86
+ | `initialProfile` | `'main' \| 'sub' \| 'third'` | `'main'` | Stream quality |
87
+ | `showAlarms` | `boolean` | `true` | Show alarm panel |
37
88
 
38
89
  ### `RvmsVideo`
39
90
 
40
- Lightweight video component same streaming engine without the alarm panel.
91
+ Lightweight player with built-in controls (play/stop, live/playback toggle, HD/SD). No alarm panel.
92
+
93
+ | Prop | Type | Default | Description |
94
+ |------|------|---------|-------------|
95
+ | `nvrId` | `string` | required | NVR UUID |
96
+ | `channelId` | `string` | required | Channel id |
97
+ | `initialProfile` | `'main' \| 'sub'` | `'main'` | Stream quality |
98
+ | `width` | `string` | `'100%'` | CSS width |
99
+ | `height` | `string` | `'auto'` | CSS height |
41
100
 
42
- ## Example
101
+ ## Backend
43
102
 
44
- See the full example in the [video-ms repository](https://github.com/humsyong/video-ms/tree/main/example).
103
+ These components need a backend that proxies `/ws/stream`, `/ws/alarms`, and `/api/*` to RVMS. See [rvms-backend](https://www.npmjs.com/package/rvms-backend) or the [example](https://github.com/humsyong/video-ms/tree/main/example).
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rvms-vue",
3
- "version": "0.1.5",
3
+ "version": "0.1.6",
4
4
  "type": "module",
5
5
  "description": "RVMS (Video-MS) Vue 3 components — RvmsVideoPlayer, RvmsVideo",
6
6
  "main": "./dist/lib/index.js",