@viji-dev/core 0.10.0 → 0.11.1
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/dist/artist-dts-p5.js +1 -1
- package/dist/artist-dts.js +1 -1
- package/dist/artist-global-p5.d.ts +1 -1
- package/dist/artist-global.d.ts +1 -1
- package/dist/assets/{viji.worker-Bvrh6HQl.js → viji.worker-BDMcYr0l.js} +2263 -2203
- package/dist/docs-api.js +6 -6
- package/dist/{essentia-wasm.web--e5vDL35.js → essentia-wasm.web-D1B5j3cM.js} +2 -2
- package/dist/{index-C-CGSJSn.js → index-D7BA9Ry-.js} +1054 -802
- package/dist/index.d.ts +118 -2
- package/dist/index.js +1 -1
- package/package.json +101 -101
package/dist/docs-api.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export const docsApi = {
|
|
2
2
|
"version": "1.1.0",
|
|
3
|
-
"coreVersion": "0.
|
|
4
|
-
"generatedAt": "2026-06-
|
|
3
|
+
"coreVersion": "0.11.1",
|
|
4
|
+
"generatedAt": "2026-06-16T17:07:32.124Z",
|
|
5
5
|
"navigation": [
|
|
6
6
|
{
|
|
7
7
|
"id": "getting-started",
|
|
@@ -4007,7 +4007,7 @@ export const docsApi = {
|
|
|
4007
4007
|
},
|
|
4008
4008
|
{
|
|
4009
4009
|
"type": "text",
|
|
4010
|
-
"markdown": "## Common Patterns\n\n### Display Device Count\n\n```javascript\nfunction render(viji) {\n const ctx = viji.useContext('2d');\n const count = viji.devices.length;\n\n ctx.fillStyle = '#111';\n ctx.fillRect(0, 0, viji.width, viji.height);\n\n ctx.fillStyle = '#fff';\n ctx.font = '24px sans-serif';\n ctx.textAlign = 'center';\n ctx.fillText(\n `${count} device${count !== 1 ? 's' : ''} connected`,\n viji.width / 2,\n viji.height / 2\n );\n}\n```\n\n### Find Device by Name\n\n```javascript\nfunction render(viji) {\n const phone = viji.devices.find(d => d.name.includes('Phone'));\n if (phone) {\n // Use phone-specific data\n }\n}\n```\n\n### Iterate All Devices\n\n```javascript\nfunction render(viji) {\n viji.devices.forEach((device, index) => {\n const hasVideo = device.video?.isConnected ?? false;\n const hasSensors = device.motion !== null;\n // Render device status at position based on index\n });\n}\n```\n\n## What's Available on Each Device\n\n| Feature | Access | Notes |\n|---------|--------|-------|\n| **Identity** | `device.id`, `device.name` | Always available |\n| **Sensors** | `device.motion`, `device.orientation` | See [Device Sensors](sensors/) |\n| **Video** | `device.video` | See [Device Video](video/) |\n| **Audio** | `device.audio` | See [Device Audio](audio/) |\n\n> [!
|
|
4010
|
+
"markdown": "## Common Patterns\n\n### Display Device Count\n\n```javascript\nfunction render(viji) {\n const ctx = viji.useContext('2d');\n const count = viji.devices.length;\n\n ctx.fillStyle = '#111';\n ctx.fillRect(0, 0, viji.width, viji.height);\n\n ctx.fillStyle = '#fff';\n ctx.font = '24px sans-serif';\n ctx.textAlign = 'center';\n ctx.fillText(\n `${count} device${count !== 1 ? 's' : ''} connected`,\n viji.width / 2,\n viji.height / 2\n );\n}\n```\n\n### Find Device by Name\n\n```javascript\nfunction render(viji) {\n const phone = viji.devices.find(d => d.name.includes('Phone'));\n if (phone) {\n // Use phone-specific data\n }\n}\n```\n\n### Iterate All Devices\n\n```javascript\nfunction render(viji) {\n viji.devices.forEach((device, index) => {\n const hasVideo = device.video?.isConnected ?? false;\n const hasSensors = device.motion !== null;\n // Render device status at position based on index\n });\n}\n```\n\n## What's Available on Each Device\n\n| Feature | Access | Notes |\n|---------|--------|-------|\n| **Identity** | `device.id`, `device.name` | Always available |\n| **Sensors** | `device.motion`, `device.orientation` | See [Device Sensors](sensors/) |\n| **Video** | `device.video` | See [Device Video](video/) |\n| **Audio** | `device.audio` | See [Device Audio](audio/) |\n\n> [!NOTE]\n> Device video CV is **remote**: the controller runs MediaPipe on its own camera and ships results back. The host never runs CV on a device stream. Enabling a feature (`device.video.cv.enableHandTracking(true)`) signals the host app to relay the request to the controller; results then appear in `device.video.cv.faces` / `hands` / `pose`. It requires the device video track to be sent (it carries the CV surface) and a CV-capable controller; otherwise the surface stays empty. `device.video.cv.analysedFrame` is always null, and body segmentation is not available on device streams.\n\n> [!NOTE]\n> Device audio provides **lightweight analysis** only: volume, frequency bands, and spectral features. Beat detection, BPM tracking, and onset events are only available on the main audio stream (`viji.audio`).\n\n## Related\n\n- [Device Audio](audio/): audio analysis from connected devices\n- [Device Video](video/): accessing camera feeds from connected devices\n- [Device Sensors](sensors/): accelerometer and orientation from connected devices\n- [Device Sensors (Internal)](../sensors/): sensors from the device running the scene\n- [P5 External Devices](/p5/external-devices): same API in the P5 renderer\n- [Shader External Device Uniforms](/shader/external-devices): GLSL uniforms for external devices"
|
|
4011
4011
|
}
|
|
4012
4012
|
]
|
|
4013
4013
|
},
|
|
@@ -4070,7 +4070,7 @@ export const docsApi = {
|
|
|
4070
4070
|
"content": [
|
|
4071
4071
|
{
|
|
4072
4072
|
"type": "text",
|
|
4073
|
-
"markdown": "# Device Video\n\nEach external device in `viji.devices` can provide a camera video feed through `device.video`. This gives you access to live video frames from connected phones, tablets, or other camera-equipped hardware.\n\n> [!
|
|
4073
|
+
"markdown": "# Device Video\n\nEach external device in `viji.devices` can provide a camera video feed through `device.video`. This gives you access to live video frames from connected phones, tablets, or other camera-equipped hardware.\n\n> [!NOTE]\n> Device video CV is **remote**: face detection, hand tracking, and pose run on the controller and ship results to `device.video.cv.faces` / `hands` / `pose`. The host never runs CV on a device stream; enabling a feature signals the host app to relay the request to the controller. It requires the device video track to be sent (the CV surface carrier) and a CV-capable controller. `analysedFrame` is always null on device streams, and body segmentation is not available there.\n\n## API Reference\n\n### VideoAPI (`device.video`)\n\n`device.video` is `null` when the device has no camera stream connected by the host. When available, it provides:\n\n| Property | Type | Description |\n|----------|------|-------------|\n| `isConnected` | `boolean` | `true` when the device camera stream is actively providing frames |\n| `currentFrame` | `OffscreenCanvas \\| null` | Current video frame, drawable with `ctx.drawImage()` |\n| `frameWidth` | `number` | Video frame width in pixels (0 when not connected) |\n| `frameHeight` | `number` | Video frame height in pixels (0 when not connected) |\n| `frameRate` | `number` | Video frame rate in Hz (0 when not connected) |\n| `getFrameData()` | `ImageData \\| null` | Raw RGBA pixel data for per-pixel analysis |\n\n## Default Values\n\n- `device.video` → `null` when the device has no camera stream\n- `device.video.currentFrame` → `null` when video is not connected\n- `device.video.frameWidth` / `frameHeight` → `0` when not connected\n- `device.video.frameRate` → `0` when not connected\n- `device.video.getFrameData()` → `null` when not connected\n\n## Guard Pattern\n\nAlways check both `device.video` existence and connection status:\n\n```javascript\nfunction render(viji) {\n for (const device of viji.devices) {\n if (device.video?.isConnected && device.video.currentFrame) {\n ctx.drawImage(device.video.currentFrame, x, y, w, h);\n }\n }\n}\n```\n\n## Basic Example"
|
|
4074
4074
|
},
|
|
4075
4075
|
{
|
|
4076
4076
|
"type": "live-example",
|
|
@@ -6732,7 +6732,7 @@ export const docsApi = {
|
|
|
6732
6732
|
},
|
|
6733
6733
|
{
|
|
6734
6734
|
"type": "text",
|
|
6735
|
-
"markdown": "## Common Patterns\n\n### Display Device Count\n\n```javascript\n// @renderer p5\n\nfunction render(viji, p5) {\n const count = viji.devices.length;\n\n p5.background(17);\n p5.fill(255);\n p5.textAlign(p5.CENTER, p5.CENTER);\n p5.textSize(24);\n p5.text(\n `${count} device${count !== 1 ? 's' : ''} connected`,\n p5.width / 2, p5.height / 2\n );\n}\n```\n\n### Find Device by Name\n\n```javascript\n// @renderer p5\n\nfunction render(viji, p5) {\n const phone = viji.devices.find(d => d.name.includes('Phone'));\n if (phone) {\n // Use phone-specific data\n }\n}\n```\n\n### Iterate All Devices\n\n```javascript\n// @renderer p5\n\nfunction render(viji, p5) {\n viji.devices.forEach((device, index) => {\n const hasVideo = device.video?.isConnected ?? false;\n const hasSensors = device.motion !== null;\n // Render device status at position based on index\n });\n}\n```\n\n## What's Available on Each Device\n\n| Feature | Access | Notes |\n|---------|--------|-------|\n| **Identity** | `device.id`, `device.name` | Always available |\n| **Sensors** | `device.motion`, `device.orientation` | See [Device Sensors](sensors/) |\n| **Video** | `device.video` | See [Device Video](video/) |\n| **Audio** | `device.audio` | See [Device Audio](audio/) |\n\n> [!
|
|
6735
|
+
"markdown": "## Common Patterns\n\n### Display Device Count\n\n```javascript\n// @renderer p5\n\nfunction render(viji, p5) {\n const count = viji.devices.length;\n\n p5.background(17);\n p5.fill(255);\n p5.textAlign(p5.CENTER, p5.CENTER);\n p5.textSize(24);\n p5.text(\n `${count} device${count !== 1 ? 's' : ''} connected`,\n p5.width / 2, p5.height / 2\n );\n}\n```\n\n### Find Device by Name\n\n```javascript\n// @renderer p5\n\nfunction render(viji, p5) {\n const phone = viji.devices.find(d => d.name.includes('Phone'));\n if (phone) {\n // Use phone-specific data\n }\n}\n```\n\n### Iterate All Devices\n\n```javascript\n// @renderer p5\n\nfunction render(viji, p5) {\n viji.devices.forEach((device, index) => {\n const hasVideo = device.video?.isConnected ?? false;\n const hasSensors = device.motion !== null;\n // Render device status at position based on index\n });\n}\n```\n\n## What's Available on Each Device\n\n| Feature | Access | Notes |\n|---------|--------|-------|\n| **Identity** | `device.id`, `device.name` | Always available |\n| **Sensors** | `device.motion`, `device.orientation` | See [Device Sensors](sensors/) |\n| **Video** | `device.video` | See [Device Video](video/) |\n| **Audio** | `device.audio` | See [Device Audio](audio/) |\n\n> [!NOTE]\n> Device video CV is **remote**: the controller runs MediaPipe on its own camera and ships results back. The host never runs CV on a device stream. Enabling a feature (`device.video.cv.enableHandTracking(true)`) signals the host app to relay the request to the controller; results then appear in `device.video.cv.faces` / `hands` / `pose`. It requires the device video track to be sent (it carries the CV surface) and a CV-capable controller; otherwise the surface stays empty. `device.video.cv.analysedFrame` is always null, and body segmentation is not available on device streams.\n\n> [!NOTE]\n> Device audio provides **lightweight analysis** only: volume, frequency bands, and spectral features. Beat detection, BPM tracking, and onset events are only available on the main audio stream (`viji.audio`).\n\n## Related\n\n- [Device Audio](audio/): audio analysis from connected devices\n- [Device Video](video/): accessing camera feeds from connected devices\n- [Device Sensors](sensors/): accelerometer and orientation from connected devices\n- [Device Sensors (Internal)](../sensors/): sensors from the device running the scene\n- [Native External Devices](/native/external-devices): same API in the Native renderer\n- [Shader External Device Uniforms](/shader/external-devices): GLSL uniforms for external devices"
|
|
6736
6736
|
}
|
|
6737
6737
|
]
|
|
6738
6738
|
},
|
|
@@ -6795,7 +6795,7 @@ export const docsApi = {
|
|
|
6795
6795
|
"content": [
|
|
6796
6796
|
{
|
|
6797
6797
|
"type": "text",
|
|
6798
|
-
"markdown": "# Device Video\n\nEach external device in `viji.devices` can provide a camera video feed through `device.video`. This gives you access to live video frames from connected phones, tablets, or other camera-equipped hardware.\n\n> [!
|
|
6798
|
+
"markdown": "# Device Video\n\nEach external device in `viji.devices` can provide a camera video feed through `device.video`. This gives you access to live video frames from connected phones, tablets, or other camera-equipped hardware.\n\n> [!NOTE]\n> Device video CV is **remote**: face detection, hand tracking, and pose run on the controller and ship results to `device.video.cv.faces` / `hands` / `pose`. The host never runs CV on a device stream; enabling a feature signals the host app to relay the request to the controller. It requires the device video track to be sent (the CV surface carrier) and a CV-capable controller. `analysedFrame` is always null on device streams, and body segmentation is not available there.\n\n## API Reference\n\n### VideoAPI (`device.video`)\n\n`device.video` is `null` when the device has no camera stream connected by the host. When available, it provides:\n\n| Property | Type | Description |\n|----------|------|-------------|\n| `isConnected` | `boolean` | `true` when the device camera stream is actively providing frames |\n| `currentFrame` | `OffscreenCanvas \\| null` | Current video frame, drawable with `p5.image()` |\n| `frameWidth` | `number` | Video frame width in pixels (0 when not connected) |\n| `frameHeight` | `number` | Video frame height in pixels (0 when not connected) |\n| `frameRate` | `number` | Video frame rate in Hz (0 when not connected) |\n| `getFrameData()` | `ImageData \\| null` | Raw RGBA pixel data for per-pixel analysis |\n\n## Default Values\n\n- `device.video` → `null` when the device has no camera stream\n- `device.video.currentFrame` → `null` when video is not connected\n- `device.video.frameWidth` / `frameHeight` → `0` when not connected\n- `device.video.frameRate` → `0` when not connected\n- `device.video.getFrameData()` → `null` when not connected\n\n## Guard Pattern\n\nAlways check both `device.video` existence and connection status. Device videos follow the same [aspect-correct pattern](/p5/video/basics/#drawing-video) as the main video stream.\n\n```javascript\n// @renderer p5\n\nfunction deviceVideoFit(device, viji, mode = 'cover') {\n const vw = device.video.frameWidth, vh = device.video.frameHeight;\n const w = viji.width, h = viji.height;\n if (!vw || !vh) return { x: 0, y: 0, width: 0, height: 0 };\n const scale = mode === 'cover' ? Math.max(w / vw, h / vh) : Math.min(w / vw, h / vh);\n const dw = vw * scale, dh = vh * scale;\n return { x: (w - dw) / 2, y: (h - dh) / 2, width: dw, height: dh };\n}\n\nfunction render(viji, p5) {\n for (const device of viji.devices) {\n if (device.video?.isConnected && device.video.currentFrame) {\n const v = deviceVideoFit(device, viji);\n p5.image(device.video.currentFrame, v.x, v.y, v.width, v.height);\n }\n }\n}\n```\n\n## Basic Example"
|
|
6799
6799
|
},
|
|
6800
6800
|
{
|
|
6801
6801
|
"type": "live-example",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { g as kn } from "./index-
|
|
1
|
+
import { g as kn } from "./index-D7BA9Ry-.js";
|
|
2
2
|
function jn(Oe, ot) {
|
|
3
3
|
for (var ve = 0; ve < ot.length; ve++) {
|
|
4
4
|
const Z = ot[ve];
|
|
@@ -3374,4 +3374,4 @@ const xn = /* @__PURE__ */ kn(yi), Ln = /* @__PURE__ */ jn({
|
|
|
3374
3374
|
export {
|
|
3375
3375
|
Ln as e
|
|
3376
3376
|
};
|
|
3377
|
-
//# sourceMappingURL=essentia-wasm.web
|
|
3377
|
+
//# sourceMappingURL=essentia-wasm.web-D1B5j3cM.js.map
|