rvms-vue 0.1.6 → 0.1.8
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.
- package/README.md +12 -1
- package/package.json +4 -2
- package/src/App.vue +25 -0
- package/src/components/RvmsVideo.vue +747 -0
- package/src/components/RvmsVideoPlayer.vue +861 -0
- package/src/export.ts +10 -0
- package/src/main.ts +4 -0
- package/src/pages/AlarmsDemo.vue +393 -0
- package/src/pages/VideoDemo.vue +151 -0
- package/src/pages/WelcomePage.vue +184 -0
- package/src/shims-vue.d.ts +5 -0
- package/src/types/index.ts +43 -0
package/README.md
CHANGED
|
@@ -100,4 +100,15 @@ Lightweight player with built-in controls (play/stop, live/playback toggle, HD/S
|
|
|
100
100
|
|
|
101
101
|
## Backend
|
|
102
102
|
|
|
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)
|
|
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).
|
|
104
|
+
|
|
105
|
+
## Full example
|
|
106
|
+
|
|
107
|
+
This package includes the complete demo application. The source is in the `src/` directory:
|
|
108
|
+
- `src/App.vue` — demo page with `RvmsVideoPlayer`
|
|
109
|
+
- `src/components/RvmsVideoPlayer.vue` — full player with alarms
|
|
110
|
+
- `src/components/RvmsVideo.vue` — simple player
|
|
111
|
+
- `src/pages/` — demo pages (VideoDemo, AlarmsDemo, WelcomePage)
|
|
112
|
+
- `src/types/` — TypeScript interfaces
|
|
113
|
+
|
|
114
|
+
See `src/pages/VideoDemo.vue` for a working example of live + playback mode with profile switching.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "rvms-vue",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.8",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "RVMS (Video-MS) Vue 3 components — RvmsVideoPlayer, RvmsVideo",
|
|
6
6
|
"main": "./dist/lib/index.js",
|
|
@@ -12,7 +12,9 @@
|
|
|
12
12
|
}
|
|
13
13
|
},
|
|
14
14
|
"files": [
|
|
15
|
-
"dist/lib"
|
|
15
|
+
"dist/lib",
|
|
16
|
+
"src",
|
|
17
|
+
"README.md"
|
|
16
18
|
],
|
|
17
19
|
"scripts": {
|
|
18
20
|
"dev": "vite",
|
package/src/App.vue
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
/**
|
|
3
|
+
* App.vue — Root page switcher.
|
|
4
|
+
*
|
|
5
|
+
* Renders the welcome page by default. Navigate to sub-pages via $emit.
|
|
6
|
+
*/
|
|
7
|
+
import { ref } from 'vue';
|
|
8
|
+
import WelcomePage from './pages/WelcomePage.vue';
|
|
9
|
+
import VideoDemo from './pages/VideoDemo.vue';
|
|
10
|
+
import AlarmsDemo from './pages/AlarmsDemo.vue';
|
|
11
|
+
|
|
12
|
+
type Page = 'welcome' | 'video' | 'alarms';
|
|
13
|
+
|
|
14
|
+
const currentPage = ref<Page>('welcome');
|
|
15
|
+
|
|
16
|
+
function goTo(page: Page) {
|
|
17
|
+
currentPage.value = page;
|
|
18
|
+
}
|
|
19
|
+
</script>
|
|
20
|
+
|
|
21
|
+
<template>
|
|
22
|
+
<WelcomePage v-if="currentPage === 'welcome'" @goto="goTo" />
|
|
23
|
+
<VideoDemo v-else-if="currentPage === 'video'" @back="goTo('welcome')" />
|
|
24
|
+
<AlarmsDemo v-else-if="currentPage === 'alarms'" @back="goTo('welcome')" />
|
|
25
|
+
</template>
|