@kubohiroya/turbowarp-camera-source 0.19.0 → 0.19.2
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.ja.md +2 -2
- package/README.md +2 -2
- package/dist/camera-source.js +17 -3
- package/package.json +2 -2
package/README.ja.md
CHANGED
|
@@ -26,13 +26,13 @@ TurboWarp-Camera-Sourceは、MediaDevicesのカメラストリームを名前付
|
|
|
26
26
|
次のURLをunsandboxed custom extensionとして読み込みます。
|
|
27
27
|
|
|
28
28
|
```text
|
|
29
|
-
https://cdn.jsdelivr.net/npm/@kubohiroya/turbowarp-camera-source@0.19.
|
|
29
|
+
https://cdn.jsdelivr.net/npm/@kubohiroya/turbowarp-camera-source@0.19.2/dist/camera-source.js
|
|
30
30
|
```
|
|
31
31
|
|
|
32
32
|
npm hostでは次を使います。
|
|
33
33
|
|
|
34
34
|
```bash
|
|
35
|
-
pnpm add @kubohiroya/turbowarp-camera-source@0.19.
|
|
35
|
+
pnpm add @kubohiroya/turbowarp-camera-source@0.19.2
|
|
36
36
|
```
|
|
37
37
|
|
|
38
38
|
## Quick start
|
package/README.md
CHANGED
|
@@ -30,13 +30,13 @@ or select separate cameras for separate roles.
|
|
|
30
30
|
Load this URL as an unsandboxed custom extension:
|
|
31
31
|
|
|
32
32
|
```text
|
|
33
|
-
https://cdn.jsdelivr.net/npm/@kubohiroya/turbowarp-camera-source@0.19.
|
|
33
|
+
https://cdn.jsdelivr.net/npm/@kubohiroya/turbowarp-camera-source@0.19.2/dist/camera-source.js
|
|
34
34
|
```
|
|
35
35
|
|
|
36
36
|
For npm hosts:
|
|
37
37
|
|
|
38
38
|
```bash
|
|
39
|
-
pnpm add @kubohiroya/turbowarp-camera-source@0.19.
|
|
39
|
+
pnpm add @kubohiroya/turbowarp-camera-source@0.19.2
|
|
40
40
|
```
|
|
41
41
|
|
|
42
42
|
## Quick Start
|
package/dist/camera-source.js
CHANGED
|
@@ -30,6 +30,7 @@
|
|
|
30
30
|
const labels = /^ja(?:-|$)/iu.test(options.locale || document.documentElement.lang || view?.navigator.language || "") ? {
|
|
31
31
|
tools: "ツール",
|
|
32
32
|
settings: "Dockの設定",
|
|
33
|
+
settingsButton: "設定",
|
|
33
34
|
edge: "表示位置",
|
|
34
35
|
autoHide: "自動的に隠す",
|
|
35
36
|
close: "閉じる",
|
|
@@ -40,6 +41,7 @@
|
|
|
40
41
|
} : {
|
|
41
42
|
tools: "Tools",
|
|
42
43
|
settings: "Dock settings",
|
|
44
|
+
settingsButton: "Settings",
|
|
43
45
|
edge: "Position",
|
|
44
46
|
autoHide: "Automatically hide",
|
|
45
47
|
close: "Close",
|
|
@@ -64,7 +66,7 @@
|
|
|
64
66
|
[data-runtime-controls-dock] button, [data-runtime-controls-dock] select {font:inherit;color:inherit;cursor:pointer}
|
|
65
67
|
[data-runtime-controls-dock] button:focus-visible, [data-runtime-controls-dock] select:focus-visible {outline:3px solid #2864bd;outline-offset:2px}
|
|
66
68
|
[data-runtime-dock-bar] {display:flex;gap:6px;padding:8px;border:1px solid #9aa8b8;border-radius:14px;background:#f5f8fceF;box-shadow:0 3px 16px #0003;backdrop-filter:blur(16px);overflow:auto;max-width:calc(100vw - 16px);max-height:calc(100vh - 48px)}
|
|
67
|
-
[data-runtime-dock-bar] button {min-width:48px;min-height:48px;border:1px solid transparent;border-radius:8px;background:transparent;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;font-size:12px}
|
|
69
|
+
[data-runtime-dock-bar] button {min-width:48px;min-height:48px;padding:0 4px;border:1px solid transparent;border-radius:8px;background:transparent;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;font-size:12px}
|
|
68
70
|
[data-runtime-dock-bar] button:hover {background:#dae5f4}
|
|
69
71
|
[data-runtime-dock-bar] button[aria-expanded=true] {border-color:#2864bd;background:#e8effb}
|
|
70
72
|
[data-runtime-dock-icon] {font-size:24px;line-height:1}
|
|
@@ -120,7 +122,13 @@
|
|
|
120
122
|
settings.append(heading, edgeLabel, autoLabel, close);
|
|
121
123
|
const gear = document.createElement("button");
|
|
122
124
|
gear.type = "button";
|
|
123
|
-
|
|
125
|
+
const gearIcon = document.createElement("span");
|
|
126
|
+
gearIcon.setAttribute("data-runtime-dock-icon", "true");
|
|
127
|
+
gearIcon.setAttribute("aria-hidden", "true");
|
|
128
|
+
gearIcon.textContent = "⚙";
|
|
129
|
+
const gearLabel = document.createElement("span");
|
|
130
|
+
gearLabel.textContent = labels.settingsButton;
|
|
131
|
+
gear.append(gearIcon, gearLabel);
|
|
124
132
|
gear.setAttribute("aria-label", labels.settings);
|
|
125
133
|
gear.title = labels.settings;
|
|
126
134
|
root.append(style, handle, bar, settings);
|
|
@@ -4102,6 +4110,7 @@
|
|
|
4102
4110
|
this.controls = /* @__PURE__ */ new Set();
|
|
4103
4111
|
this.standaloneControls = null;
|
|
4104
4112
|
this.cameraButtons = /* @__PURE__ */ new Map();
|
|
4113
|
+
this.cameraButtonStreams = /* @__PURE__ */ new WeakSet();
|
|
4105
4114
|
this.profiles = new CameraProfileRegistry();
|
|
4106
4115
|
this.generations = /* @__PURE__ */ new Map();
|
|
4107
4116
|
this.lastConditions = /* @__PURE__ */ new Map();
|
|
@@ -4535,6 +4544,7 @@
|
|
|
4535
4544
|
return;
|
|
4536
4545
|
}
|
|
4537
4546
|
try {
|
|
4547
|
+
this.cameraButtonStreams.add(outcome.stream);
|
|
4538
4548
|
this.blockLeases.set(cameraId, await this.adoptCamera({
|
|
4539
4549
|
owner: "camera-source-block",
|
|
4540
4550
|
cameraId,
|
|
@@ -5045,7 +5055,11 @@
|
|
|
5045
5055
|
session.preview?.dispose();
|
|
5046
5056
|
session.frameTimes?.dispose();
|
|
5047
5057
|
session.frameTimes = null;
|
|
5048
|
-
|
|
5058
|
+
const stream = session.stream;
|
|
5059
|
+
if (stream && (!session.adopted || this.cameraButtonStreams.has(stream))) {
|
|
5060
|
+
this.cameraButtonStreams.delete(stream);
|
|
5061
|
+
stream.getTracks().forEach((track) => track.stop());
|
|
5062
|
+
}
|
|
5049
5063
|
if (session.video) session.video.srcObject = null;
|
|
5050
5064
|
session.stream = null;
|
|
5051
5065
|
session.video = null;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kubohiroya/turbowarp-camera-source",
|
|
3
|
-
"version": "0.19.
|
|
3
|
+
"version": "0.19.2",
|
|
4
4
|
"author": "Hiroya Kubo <hiroya@cuc.ac.jp>",
|
|
5
5
|
"description": "A TurboWarp capability extension for sharing one MediaDevices camera stream across extensions.",
|
|
6
6
|
"type": "module",
|
|
@@ -71,7 +71,7 @@
|
|
|
71
71
|
"prepare": "npm run build"
|
|
72
72
|
},
|
|
73
73
|
"devDependencies": {
|
|
74
|
-
"@kubohiroya/turbowarp-app-shell": "0.3.
|
|
74
|
+
"@kubohiroya/turbowarp-app-shell": "0.3.1",
|
|
75
75
|
"@eslint/js": "^9.39.5",
|
|
76
76
|
"@kubohiroya/turbowarp-extension-manifest": "0.3.2",
|
|
77
77
|
"@kubohiroya/vite-plugin-turbowarp-extension": "0.6.1",
|