camstreamerlib 4.0.32 → 4.0.33
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 +9 -0
- package/cjs/browser.index.d.ts +2 -0
- package/cjs/browser.index.js +18 -0
- package/esm/browser.index.js +2 -0
- package/examples/README.md +43 -0
- package/examples/camstreamerlib.js +13201 -0
- package/examples/camswitcher-events.html +137 -0
- package/examples/planetracker-events.html +186 -0
- package/examples/utils/example.css +102 -0
- package/package.json +6 -3
- package/types/browser.index.d.ts +2 -0
package/README.md
CHANGED
|
@@ -39,6 +39,15 @@ npm install camstreamerlib
|
|
|
39
39
|
|
|
40
40
|
</br>
|
|
41
41
|
|
|
42
|
+
# Examples
|
|
43
|
+
|
|
44
|
+
| Example | Description | Open in browser |
|
|
45
|
+
| --------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- |
|
|
46
|
+
| [CamSwitcherEvents](examples/camswitcher-events.html) ([source](https://github.com/CamStreamer/CamStreamerLib/blob/master/examples/camswitcher-events.html)) | Logs every CamSwitcher event. `DeviceConnectClient` (HTTP) backs [CamSwitcherAPI](doc/CamSwitcherAPI.md) to obtain the websocket authorization token, `DeviceConnectWsClient` (websocket) backs [CamSwitcherEvents](doc/ws/CamSwitcherEvents.md), which validates and dispatches the events. Connection state is taken from the `authorization` event. | [open](https://camstreamer.github.io/CamStreamerLib/examples/camswitcher-events.html) |
|
|
47
|
+
| [PlaneTrackerEvents](examples/planetracker-events.html) ([source](https://github.com/CamStreamer/CamStreamerLib/blob/master/examples/planetracker-events.html)) | Logs every PlaneTracker event. PlaneTracker needs no authorization token — [PlaneTrackerEvents](doc/ws/PlaneTrackerEvents.md) announces the connecting user (`userId` / `userName` / `userPriority`, editable in the form) as the init message instead, so only the websocket client is needed. The continuous `CAMERA_POSITION` and `FLIGHT_LIST` events only update the summary line unless the checkbox is ticked. | [open](https://camstreamer.github.io/CamStreamerLib/examples/planetracker-events.html) |
|
|
48
|
+
|
|
49
|
+
</br>
|
|
50
|
+
|
|
42
51
|
# Breaking Changes
|
|
43
52
|
|
|
44
53
|
<details open>
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./index"), exports);
|
|
18
|
+
__exportStar(require("./web/index"), exports);
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
# Examples
|
|
2
|
+
|
|
3
|
+
Standalone browser examples that use CamStreamerLib directly from a `<script type="module">`,
|
|
4
|
+
without a bundler or a framework.
|
|
5
|
+
|
|
6
|
+
## Build the browser bundle
|
|
7
|
+
|
|
8
|
+
```bash
|
|
9
|
+
npm install
|
|
10
|
+
npm run build:browser
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Run
|
|
14
|
+
|
|
15
|
+
Modules can't be loaded over `file://`, so serve the folder over HTTP:
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
npx serve examples
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
Both pages connect to a camera through the Device Connect proxy. Fill in the device host
|
|
22
|
+
(`<MAC_ADDRESS>.device-connect.net`) and the device access token in the form, or hardcode them in the
|
|
23
|
+
`DEVICE_HOST` / `DEVICE_ACCESS_TOKEN` constants at the top of the page's script to have the form
|
|
24
|
+
prefilled. See [doc/Client.md](../doc/Client.md).
|
|
25
|
+
|
|
26
|
+
## camswitcher-events.html
|
|
27
|
+
|
|
28
|
+
Logs every CamSwitcher event. `DeviceConnectClient` (HTTP) backs `CamSwitcherAPI` to obtain the
|
|
29
|
+
websocket authorization token; `DeviceConnectWsClient` (websocket) backs `CamSwitcherEvents`, which
|
|
30
|
+
validates and dispatches the events. Connection state is taken from the `authorization` event.
|
|
31
|
+
|
|
32
|
+
See [doc/ws/CamSwitcherEvents.md](../doc/ws/CamSwitcherEvents.md).
|
|
33
|
+
|
|
34
|
+
## planetracker-events.html
|
|
35
|
+
|
|
36
|
+
Logs every PlaneTracker event. PlaneTracker needs no authorization token — `PlaneTrackerEvents`
|
|
37
|
+
announces the connecting user (`userId` / `userName` / `userPriority`, editable in the form) as the
|
|
38
|
+
init message instead, so only the websocket client is needed.
|
|
39
|
+
|
|
40
|
+
`CAMERA_POSITION` and `FLIGHT_LIST` arrive continuously, so by default they only update the summary
|
|
41
|
+
line above the log; tick the checkbox to log them as well.
|
|
42
|
+
|
|
43
|
+
See [doc/ws/PlaneTrackerEvents.md](../doc/ws/PlaneTrackerEvents.md).
|