@pipecat-ai/client-react 0.4.1 → 1.0.0
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 +46 -47
- package/dist/index.d.ts +18 -18
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +155 -100
- package/dist/index.js.map +1 -1
- package/dist/index.module.js +147 -92
- package/dist/index.module.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -2,8 +2,8 @@ var $5Zyvw$reactjsxruntime = require("react/jsx-runtime");
|
|
|
2
2
|
var $5Zyvw$pipecataiclientjs = require("@pipecat-ai/client-js");
|
|
3
3
|
var $5Zyvw$react = require("react");
|
|
4
4
|
var $5Zyvw$jotai = require("jotai");
|
|
5
|
-
var $5Zyvw$jotaireact = require("jotai/react");
|
|
6
5
|
var $5Zyvw$jotaiutils = require("jotai/utils");
|
|
6
|
+
var $5Zyvw$jotaireact = require("jotai/react");
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
function $parcel$export(e, n, v, s) {
|
|
@@ -14,18 +14,18 @@ function $parcel$interopDefault(a) {
|
|
|
14
14
|
return a && a.__esModule ? a.default : a;
|
|
15
15
|
}
|
|
16
16
|
|
|
17
|
-
$parcel$export(module.exports, "
|
|
18
|
-
$parcel$export(module.exports, "
|
|
19
|
-
$parcel$export(module.exports, "
|
|
20
|
-
$parcel$export(module.exports, "
|
|
21
|
-
$parcel$export(module.exports, "
|
|
22
|
-
$parcel$export(module.exports, "
|
|
23
|
-
$parcel$export(module.exports, "
|
|
17
|
+
$parcel$export(module.exports, "PipecatClientAudio", () => $a2a1c5f475114d56$export$b52250cb73ff4de1);
|
|
18
|
+
$parcel$export(module.exports, "PipecatClientCamToggle", () => $666ceba11158b494$export$dc9a029eeca8213f);
|
|
19
|
+
$parcel$export(module.exports, "PipecatClientMicToggle", () => $1a9931980e271aa3$export$bc8133b69ff660a2);
|
|
20
|
+
$parcel$export(module.exports, "PipecatClientProvider", () => $8df0e777e4d7dd49$export$bb43666ced7a20d0);
|
|
21
|
+
$parcel$export(module.exports, "PipecatClientVideo", () => $0f97689637ada1d8$export$85974db6d0cc43b3);
|
|
22
|
+
$parcel$export(module.exports, "usePipecatClient", () => $172f489fc5d91d99$export$777fa8498be78705);
|
|
23
|
+
$parcel$export(module.exports, "usePipecatClientCamControl", () => $d9b24817de62910a$export$3ea2601427f0430f);
|
|
24
|
+
$parcel$export(module.exports, "usePipecatClientMediaDevices", () => $9bd3e7d3a9d7acd1$export$642bc4d2d2a376f1);
|
|
25
|
+
$parcel$export(module.exports, "usePipecatClientMediaTrack", () => $630203d8dad1dd45$export$9813dcd2d0c26814);
|
|
26
|
+
$parcel$export(module.exports, "usePipecatClientMicControl", () => $4af0eba414c586fd$export$388e706586309ef0);
|
|
27
|
+
$parcel$export(module.exports, "usePipecatClientTransportState", () => $810478f6ae107062$export$30aee278309a867b);
|
|
24
28
|
$parcel$export(module.exports, "useRTVIClientEvent", () => $8a6b68ebf0332682$export$33a6ac53b8f02625);
|
|
25
|
-
$parcel$export(module.exports, "useRTVIClientMediaDevices", () => $01bcacdf0a25e20c$export$652c54907b83a48d);
|
|
26
|
-
$parcel$export(module.exports, "useRTVIClientMediaTrack", () => $e5be552b22401c66$export$7c03381e0d26a6c3);
|
|
27
|
-
$parcel$export(module.exports, "useRTVIClientMicControl", () => $b5946020fafb75c5$export$805915964ad7bc25);
|
|
28
|
-
$parcel$export(module.exports, "useRTVIClientTransportState", () => $6b6c1a9f794236bd$export$599fa01283bd4ece);
|
|
29
29
|
$parcel$export(module.exports, "VoiceVisualizer", () => $a1dfa75b13e6bb9b$export$59bf27bd43679db6);
|
|
30
30
|
/**
|
|
31
31
|
* Copyright (c) 2024, Daily.
|
|
@@ -39,6 +39,9 @@ $parcel$export(module.exports, "VoiceVisualizer", () => $a1dfa75b13e6bb9b$export
|
|
|
39
39
|
*
|
|
40
40
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
41
41
|
*/
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
|
|
42
45
|
/**
|
|
43
46
|
* Copyright (c) 2024, Daily.
|
|
44
47
|
*
|
|
@@ -48,81 +51,132 @@ $parcel$export(module.exports, "VoiceVisualizer", () => $a1dfa75b13e6bb9b$export
|
|
|
48
51
|
|
|
49
52
|
|
|
50
53
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
+
|
|
55
|
+
var $d1f89db81f967f39$exports = {};
|
|
56
|
+
$d1f89db81f967f39$exports = JSON.parse("{\"name\":\"@pipecat-ai/client-react\",\"version\":\"1.0.0\",\"license\":\"BSD-2-Clause\",\"main\":\"dist/index.js\",\"module\":\"dist/index.module.js\",\"types\":\"dist/index.d.ts\",\"source\":\"src/index.ts\",\"repository\":{\"type\":\"git\",\"url\":\"git+https://github.com/pipecat-ai/pipecat-client-web.git\"},\"files\":[\"dist\",\"package.json\",\"README.md\"],\"scripts\":{\"build\":\"parcel build --no-cache\",\"dev\":\"parcel watch\",\"lint\":\"eslint . --report-unused-disable-directives --max-warnings 0 --ignore-pattern 'dist/'\"},\"devDependencies\":{\"@pipecat-ai/client-js\":\"*\",\"@types/react\":\"^18.3.3\",\"@types/react-dom\":\"^18.3.0\",\"@typescript-eslint/eslint-plugin\":\"^8.32.0\",\"eslint\":\"^9.11.1\",\"eslint-config-prettier\":\"^9.1.0\",\"eslint-plugin-react-hooks\":\"^5.2.0\",\"eslint-plugin-simple-import-sort\":\"^12.1.1\",\"parcel\":\"^2.12.0\",\"react\":\"^18.3.1\",\"react-dom\":\"^18.3.1\",\"typescript\":\"^5.2.2\"},\"peerDependencies\":{\"@pipecat-ai/client-js\":\"*\",\"react\":\">=18\",\"react-dom\":\">=18\"},\"dependencies\":{\"jotai\":\"^2.9.0\"}}");
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
const $a37ab5d1bcf1d3b2$export$fe23d0ef95286467 = /*#__PURE__*/ (0, $5Zyvw$react.createContext)({
|
|
61
|
+
on: ()=>{},
|
|
62
|
+
off: ()=>{}
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
const $8df0e777e4d7dd49$var$defaultStore = (0, $5Zyvw$jotai.createStore)();
|
|
67
|
+
const $8df0e777e4d7dd49$export$67f6d73bc6cd7bb1 = /*#__PURE__*/ (0, $5Zyvw$react.createContext)({});
|
|
68
|
+
const $8df0e777e4d7dd49$export$bb43666ced7a20d0 = ({ children: children, client: client, jotaiStore: jotaiStore = $8df0e777e4d7dd49$var$defaultStore })=>{
|
|
69
|
+
(0, $5Zyvw$react.useEffect)(()=>{
|
|
70
|
+
(0, $5Zyvw$pipecataiclientjs.setAboutClient)({
|
|
71
|
+
library: (0, $d1f89db81f967f39$exports.name),
|
|
72
|
+
library_version: (0, $d1f89db81f967f39$exports.version)
|
|
73
|
+
});
|
|
74
|
+
}, []);
|
|
75
|
+
const eventHandlersMap = (0, $5Zyvw$react.useRef)({});
|
|
76
|
+
(0, $5Zyvw$react.useEffect)(()=>{
|
|
77
|
+
if (!client) return;
|
|
78
|
+
const allEvents = Object.values((0, $5Zyvw$pipecataiclientjs.RTVIEvent)).filter((value)=>isNaN(Number(value)));
|
|
79
|
+
const allHandlers = {};
|
|
80
|
+
allEvents.forEach((event)=>{
|
|
81
|
+
const handler = (...payload)=>{
|
|
82
|
+
const handlers = eventHandlersMap.current[event];
|
|
83
|
+
if (!handlers) return;
|
|
84
|
+
handlers.forEach((h)=>{
|
|
85
|
+
h(...payload);
|
|
86
|
+
});
|
|
87
|
+
};
|
|
88
|
+
allHandlers[event] = handler;
|
|
89
|
+
client.on(event, handler);
|
|
90
|
+
});
|
|
91
|
+
return ()=>{
|
|
92
|
+
allEvents.forEach((event)=>{
|
|
93
|
+
client.off(event, allHandlers[event]);
|
|
94
|
+
});
|
|
95
|
+
};
|
|
96
|
+
}, [
|
|
97
|
+
client
|
|
98
|
+
]);
|
|
99
|
+
const on = (0, $5Zyvw$react.useCallback)((event, handler)=>{
|
|
100
|
+
if (!eventHandlersMap.current[event]) eventHandlersMap.current[event] = new Set();
|
|
101
|
+
eventHandlersMap.current[event].add(handler);
|
|
102
|
+
}, []);
|
|
103
|
+
const off = (0, $5Zyvw$react.useCallback)((event, handler)=>{
|
|
104
|
+
eventHandlersMap.current[event]?.delete(handler);
|
|
105
|
+
}, []);
|
|
54
106
|
return (0, $5Zyvw$reactjsxruntime.jsx)((0, $5Zyvw$jotaireact.Provider), {
|
|
55
107
|
store: jotaiStore,
|
|
56
|
-
children: (0, $5Zyvw$reactjsxruntime.jsx)($
|
|
108
|
+
children: (0, $5Zyvw$reactjsxruntime.jsx)($8df0e777e4d7dd49$export$67f6d73bc6cd7bb1.Provider, {
|
|
57
109
|
value: {
|
|
58
110
|
client: client
|
|
59
111
|
},
|
|
60
|
-
children:
|
|
112
|
+
children: (0, $5Zyvw$reactjsxruntime.jsx)((0, $a37ab5d1bcf1d3b2$export$fe23d0ef95286467).Provider, {
|
|
113
|
+
value: {
|
|
114
|
+
on: on,
|
|
115
|
+
off: off
|
|
116
|
+
},
|
|
117
|
+
children: children
|
|
118
|
+
})
|
|
61
119
|
})
|
|
62
120
|
});
|
|
63
121
|
};
|
|
64
|
-
$
|
|
122
|
+
$8df0e777e4d7dd49$export$bb43666ced7a20d0.displayName = "PipecatClientProvider";
|
|
65
123
|
|
|
66
124
|
|
|
67
|
-
const $
|
|
68
|
-
const { client: client } = (0, $5Zyvw$react.useContext)((0, $
|
|
125
|
+
const $172f489fc5d91d99$export$777fa8498be78705 = ()=>{
|
|
126
|
+
const { client: client } = (0, $5Zyvw$react.useContext)((0, $8df0e777e4d7dd49$export$67f6d73bc6cd7bb1));
|
|
69
127
|
return client;
|
|
70
128
|
};
|
|
71
129
|
|
|
72
130
|
|
|
131
|
+
/**
|
|
132
|
+
* Copyright (c) 2024, Daily.
|
|
133
|
+
*
|
|
134
|
+
* SPDX-License-Identifier: BSD-2-Clause
|
|
135
|
+
*/
|
|
136
|
+
|
|
73
137
|
const $8a6b68ebf0332682$export$33a6ac53b8f02625 = (event, handler)=>{
|
|
74
|
-
const
|
|
138
|
+
const { on: on, off: off } = (0, $5Zyvw$react.useContext)((0, $a37ab5d1bcf1d3b2$export$fe23d0ef95286467));
|
|
75
139
|
(0, $5Zyvw$react.useEffect)(()=>{
|
|
76
|
-
|
|
77
|
-
client.on(event, handler);
|
|
140
|
+
on(event, handler);
|
|
78
141
|
return ()=>{
|
|
79
|
-
|
|
142
|
+
off(event, handler);
|
|
80
143
|
};
|
|
81
144
|
}, [
|
|
82
145
|
event,
|
|
83
146
|
handler,
|
|
84
|
-
|
|
147
|
+
on,
|
|
148
|
+
off
|
|
85
149
|
]);
|
|
86
150
|
};
|
|
87
151
|
|
|
88
152
|
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
const $e5be552b22401c66$var$localAudioTrackAtom = (0, $5Zyvw$jotai.atom)(null);
|
|
100
|
-
const $e5be552b22401c66$var$localVideoTrackAtom = (0, $5Zyvw$jotai.atom)(null);
|
|
101
|
-
const $e5be552b22401c66$var$localScreenAudioTrackAtom = (0, $5Zyvw$jotai.atom)(null);
|
|
102
|
-
const $e5be552b22401c66$var$localScreenVideoTrackAtom = (0, $5Zyvw$jotai.atom)(null);
|
|
103
|
-
const $e5be552b22401c66$var$botAudioTrackAtom = (0, $5Zyvw$jotai.atom)(null);
|
|
104
|
-
const $e5be552b22401c66$var$botVideoTrackAtom = (0, $5Zyvw$jotai.atom)(null);
|
|
105
|
-
const $e5be552b22401c66$var$trackAtom = (0, $5Zyvw$jotaiutils.atomFamily)(({ local: local, trackType: trackType })=>{
|
|
153
|
+
const $630203d8dad1dd45$var$localAudioTrackAtom = (0, $5Zyvw$jotai.atom)(null);
|
|
154
|
+
const $630203d8dad1dd45$var$localVideoTrackAtom = (0, $5Zyvw$jotai.atom)(null);
|
|
155
|
+
const $630203d8dad1dd45$var$localScreenAudioTrackAtom = (0, $5Zyvw$jotai.atom)(null);
|
|
156
|
+
const $630203d8dad1dd45$var$localScreenVideoTrackAtom = (0, $5Zyvw$jotai.atom)(null);
|
|
157
|
+
const $630203d8dad1dd45$var$botAudioTrackAtom = (0, $5Zyvw$jotai.atom)(null);
|
|
158
|
+
const $630203d8dad1dd45$var$botVideoTrackAtom = (0, $5Zyvw$jotai.atom)(null);
|
|
159
|
+
const $630203d8dad1dd45$var$trackAtom = (0, $5Zyvw$jotaiutils.atomFamily)(({ local: local, trackType: trackType })=>{
|
|
106
160
|
if (local) switch(trackType){
|
|
107
161
|
case "audio":
|
|
108
|
-
return $
|
|
162
|
+
return $630203d8dad1dd45$var$localAudioTrackAtom;
|
|
109
163
|
case "screenAudio":
|
|
110
|
-
return $
|
|
164
|
+
return $630203d8dad1dd45$var$localScreenAudioTrackAtom;
|
|
111
165
|
case "screenVideo":
|
|
112
|
-
return $
|
|
166
|
+
return $630203d8dad1dd45$var$localScreenVideoTrackAtom;
|
|
113
167
|
case "video":
|
|
114
|
-
return $
|
|
168
|
+
return $630203d8dad1dd45$var$localVideoTrackAtom;
|
|
115
169
|
}
|
|
116
|
-
return trackType === "audio" ? $
|
|
170
|
+
return trackType === "audio" ? $630203d8dad1dd45$var$botAudioTrackAtom : $630203d8dad1dd45$var$botVideoTrackAtom;
|
|
117
171
|
});
|
|
118
|
-
const $
|
|
119
|
-
const client = (0, $
|
|
120
|
-
const track = (0, $5Zyvw$jotai.useAtomValue)($
|
|
172
|
+
const $630203d8dad1dd45$export$9813dcd2d0c26814 = (trackType, participantType)=>{
|
|
173
|
+
const client = (0, $172f489fc5d91d99$export$777fa8498be78705)();
|
|
174
|
+
const track = (0, $5Zyvw$jotai.useAtomValue)($630203d8dad1dd45$var$trackAtom({
|
|
121
175
|
local: participantType === "local",
|
|
122
176
|
trackType: trackType
|
|
123
177
|
}));
|
|
124
178
|
const updateTrack = (0, $5Zyvw$jotaiutils.useAtomCallback)((0, $5Zyvw$react.useCallback)((get, set, track, trackType, local)=>{
|
|
125
|
-
const atom = $
|
|
179
|
+
const atom = $630203d8dad1dd45$var$trackAtom({
|
|
126
180
|
local: local,
|
|
127
181
|
trackType: trackType
|
|
128
182
|
});
|
|
@@ -157,9 +211,10 @@ const $e5be552b22401c66$export$7c03381e0d26a6c3 = (trackType, participantType)=>
|
|
|
157
211
|
};
|
|
158
212
|
|
|
159
213
|
|
|
160
|
-
|
|
214
|
+
|
|
215
|
+
const $a2a1c5f475114d56$export$b52250cb73ff4de1 = ()=>{
|
|
161
216
|
const botAudioRef = (0, $5Zyvw$react.useRef)(null);
|
|
162
|
-
const botAudioTrack = (0, $
|
|
217
|
+
const botAudioTrack = (0, $630203d8dad1dd45$export$9813dcd2d0c26814)("audio", "bot");
|
|
163
218
|
(0, $5Zyvw$react.useEffect)(()=>{
|
|
164
219
|
if (!botAudioRef.current || !botAudioTrack) return;
|
|
165
220
|
if (botAudioRef.current.srcObject) {
|
|
@@ -184,7 +239,7 @@ const $e6a9aa6ceb34e585$export$ba1245f7cbf3ae02 = ()=>{
|
|
|
184
239
|
})
|
|
185
240
|
});
|
|
186
241
|
};
|
|
187
|
-
$
|
|
242
|
+
$a2a1c5f475114d56$export$b52250cb73ff4de1.displayName = "PipecatClientAudio";
|
|
188
243
|
|
|
189
244
|
|
|
190
245
|
|
|
@@ -198,18 +253,18 @@ $e6a9aa6ceb34e585$export$ba1245f7cbf3ae02.displayName = "RTVIClientAudio";
|
|
|
198
253
|
*/
|
|
199
254
|
|
|
200
255
|
|
|
201
|
-
const $
|
|
202
|
-
const $
|
|
203
|
-
const [transportState, setTransportState] = (0, $5Zyvw$jotai.useAtom)($
|
|
256
|
+
const $810478f6ae107062$var$transportStateAtom = (0, $5Zyvw$jotai.atom)("disconnected");
|
|
257
|
+
const $810478f6ae107062$export$30aee278309a867b = ()=>{
|
|
258
|
+
const [transportState, setTransportState] = (0, $5Zyvw$jotai.useAtom)($810478f6ae107062$var$transportStateAtom);
|
|
204
259
|
(0, $8a6b68ebf0332682$export$33a6ac53b8f02625)((0, $5Zyvw$pipecataiclientjs.RTVIEvent).TransportStateChanged, setTransportState);
|
|
205
260
|
return transportState;
|
|
206
261
|
};
|
|
207
262
|
|
|
208
263
|
|
|
209
|
-
const $
|
|
210
|
-
const client = (0, $
|
|
264
|
+
const $d9b24817de62910a$export$3ea2601427f0430f = ()=>{
|
|
265
|
+
const client = (0, $172f489fc5d91d99$export$777fa8498be78705)();
|
|
211
266
|
const [isCamEnabled, setIsCamEnabled] = (0, $5Zyvw$react.useState)(client?.isCamEnabled ?? false);
|
|
212
|
-
const transportState = (0, $
|
|
267
|
+
const transportState = (0, $810478f6ae107062$export$30aee278309a867b)();
|
|
213
268
|
// Sync component state with client state initially
|
|
214
269
|
(0, $5Zyvw$react.useEffect)(()=>{
|
|
215
270
|
if (!client || transportState !== "initialized" || typeof client.isCamEnabled !== "boolean") return;
|
|
@@ -231,8 +286,8 @@ const $affd351738e2f16c$export$46099a7ec2fe8ac5 = ()=>{
|
|
|
231
286
|
};
|
|
232
287
|
|
|
233
288
|
|
|
234
|
-
const $
|
|
235
|
-
const { isCamEnabled: isCamEnabled, enableCam: enableCam } = (0, $
|
|
289
|
+
const $666ceba11158b494$export$dc9a029eeca8213f = ({ onCamEnabledChanged: onCamEnabledChanged, disabled: disabled = false, children: children })=>{
|
|
290
|
+
const { isCamEnabled: isCamEnabled, enableCam: enableCam } = (0, $d9b24817de62910a$export$3ea2601427f0430f)();
|
|
236
291
|
const handleToggleCam = (0, $5Zyvw$react.useCallback)(()=>{
|
|
237
292
|
if (disabled) return;
|
|
238
293
|
const newEnabledState = !isCamEnabled;
|
|
@@ -252,7 +307,7 @@ const $e7a27a30474b270e$export$156c26e16246ae3e = ({ onCamEnabledChanged: onCamE
|
|
|
252
307
|
})
|
|
253
308
|
});
|
|
254
309
|
};
|
|
255
|
-
var $
|
|
310
|
+
var $666ceba11158b494$export$2e2bcd8739ae039 = $666ceba11158b494$export$dc9a029eeca8213f;
|
|
256
311
|
|
|
257
312
|
|
|
258
313
|
|
|
@@ -260,10 +315,10 @@ var $e7a27a30474b270e$export$2e2bcd8739ae039 = $e7a27a30474b270e$export$156c26e1
|
|
|
260
315
|
|
|
261
316
|
|
|
262
317
|
|
|
263
|
-
const $
|
|
264
|
-
const client = (0, $
|
|
318
|
+
const $4af0eba414c586fd$export$388e706586309ef0 = ()=>{
|
|
319
|
+
const client = (0, $172f489fc5d91d99$export$777fa8498be78705)();
|
|
265
320
|
const [isMicEnabled, setIsMicEnabled] = (0, $5Zyvw$react.useState)(client?.isMicEnabled ?? false);
|
|
266
|
-
const transportState = (0, $
|
|
321
|
+
const transportState = (0, $810478f6ae107062$export$30aee278309a867b)();
|
|
267
322
|
// Sync component state with client state initially
|
|
268
323
|
(0, $5Zyvw$react.useEffect)(()=>{
|
|
269
324
|
if (!client || transportState !== "initialized" || typeof client.isMicEnabled !== "boolean") return;
|
|
@@ -285,8 +340,8 @@ const $b5946020fafb75c5$export$805915964ad7bc25 = ()=>{
|
|
|
285
340
|
};
|
|
286
341
|
|
|
287
342
|
|
|
288
|
-
const $
|
|
289
|
-
const { enableMic: enableMic, isMicEnabled: isMicEnabled } = (0, $
|
|
343
|
+
const $1a9931980e271aa3$export$bc8133b69ff660a2 = ({ onMicEnabledChanged: onMicEnabledChanged, disabled: disabled = false, children: children })=>{
|
|
344
|
+
const { enableMic: enableMic, isMicEnabled: isMicEnabled } = (0, $4af0eba414c586fd$export$388e706586309ef0)();
|
|
290
345
|
const handleToggleMic = (0, $5Zyvw$react.useCallback)(()=>{
|
|
291
346
|
if (disabled) return;
|
|
292
347
|
const newEnabledState = !isMicEnabled;
|
|
@@ -306,7 +361,7 @@ const $8a175691955798a2$export$bf1c2c9ca877628d = ({ onMicEnabledChanged: onMicE
|
|
|
306
361
|
})
|
|
307
362
|
});
|
|
308
363
|
};
|
|
309
|
-
var $
|
|
364
|
+
var $1a9931980e271aa3$export$2e2bcd8739ae039 = $1a9931980e271aa3$export$bc8133b69ff660a2;
|
|
310
365
|
|
|
311
366
|
|
|
312
367
|
|
|
@@ -336,8 +391,8 @@ var $a73c18d97634a8ff$export$2e2bcd8739ae039 = $a73c18d97634a8ff$var$useMergedRe
|
|
|
336
391
|
|
|
337
392
|
|
|
338
393
|
|
|
339
|
-
const $
|
|
340
|
-
const videoTrack = (0, $
|
|
394
|
+
const $0f97689637ada1d8$export$85974db6d0cc43b3 = /*#__PURE__*/ (0, $5Zyvw$react.forwardRef)(function VoiceClientVideo({ participant: participant = "local", fit: fit = "contain", mirror: mirror, onResize: onResize, style: style = {}, trackType: trackType = "video", ...props }, ref) {
|
|
395
|
+
const videoTrack = (0, $630203d8dad1dd45$export$9813dcd2d0c26814)(trackType, participant);
|
|
341
396
|
const videoEl = (0, $5Zyvw$react.useRef)(null);
|
|
342
397
|
const videoRef = (0, $a73c18d97634a8ff$export$2e2bcd8739ae039)(videoEl, ref);
|
|
343
398
|
/**
|
|
@@ -449,8 +504,7 @@ const $c1952f9ddec789e5$export$d090a384943608eb = /*#__PURE__*/ (0, $5Zyvw$react
|
|
|
449
504
|
...props
|
|
450
505
|
});
|
|
451
506
|
});
|
|
452
|
-
$
|
|
453
|
-
|
|
507
|
+
$0f97689637ada1d8$export$85974db6d0cc43b3.displayName = "PipecatClientVideo";
|
|
454
508
|
|
|
455
509
|
|
|
456
510
|
|
|
@@ -461,31 +515,31 @@ $c1952f9ddec789e5$export$d090a384943608eb.displayName = "RTVIClientVideo";
|
|
|
461
515
|
|
|
462
516
|
|
|
463
517
|
|
|
464
|
-
const $
|
|
465
|
-
const $
|
|
466
|
-
const $
|
|
467
|
-
const $
|
|
468
|
-
const $
|
|
469
|
-
const $
|
|
470
|
-
const $
|
|
471
|
-
const client = (0, $
|
|
472
|
-
const availableCams = (0, $5Zyvw$jotai.useAtomValue)($
|
|
473
|
-
const availableMics = (0, $5Zyvw$jotai.useAtomValue)($
|
|
474
|
-
const availableSpeakers = (0, $5Zyvw$jotai.useAtomValue)($
|
|
475
|
-
const selectedCam = (0, $5Zyvw$jotai.useAtomValue)($
|
|
476
|
-
const selectedMic = (0, $5Zyvw$jotai.useAtomValue)($
|
|
477
|
-
const selectedSpeaker = (0, $5Zyvw$jotai.useAtomValue)($
|
|
518
|
+
const $9bd3e7d3a9d7acd1$var$availableMicsAtom = (0, $5Zyvw$jotai.atom)([]);
|
|
519
|
+
const $9bd3e7d3a9d7acd1$var$availableCamsAtom = (0, $5Zyvw$jotai.atom)([]);
|
|
520
|
+
const $9bd3e7d3a9d7acd1$var$availableSpeakersAtom = (0, $5Zyvw$jotai.atom)([]);
|
|
521
|
+
const $9bd3e7d3a9d7acd1$var$selectedMicAtom = (0, $5Zyvw$jotai.atom)({});
|
|
522
|
+
const $9bd3e7d3a9d7acd1$var$selectedCamAtom = (0, $5Zyvw$jotai.atom)({});
|
|
523
|
+
const $9bd3e7d3a9d7acd1$var$selectedSpeakerAtom = (0, $5Zyvw$jotai.atom)({});
|
|
524
|
+
const $9bd3e7d3a9d7acd1$export$642bc4d2d2a376f1 = ()=>{
|
|
525
|
+
const client = (0, $172f489fc5d91d99$export$777fa8498be78705)();
|
|
526
|
+
const availableCams = (0, $5Zyvw$jotai.useAtomValue)($9bd3e7d3a9d7acd1$var$availableCamsAtom);
|
|
527
|
+
const availableMics = (0, $5Zyvw$jotai.useAtomValue)($9bd3e7d3a9d7acd1$var$availableMicsAtom);
|
|
528
|
+
const availableSpeakers = (0, $5Zyvw$jotai.useAtomValue)($9bd3e7d3a9d7acd1$var$availableSpeakersAtom);
|
|
529
|
+
const selectedCam = (0, $5Zyvw$jotai.useAtomValue)($9bd3e7d3a9d7acd1$var$selectedCamAtom);
|
|
530
|
+
const selectedMic = (0, $5Zyvw$jotai.useAtomValue)($9bd3e7d3a9d7acd1$var$selectedMicAtom);
|
|
531
|
+
const selectedSpeaker = (0, $5Zyvw$jotai.useAtomValue)($9bd3e7d3a9d7acd1$var$selectedSpeakerAtom);
|
|
478
532
|
const initDevices = (0, $5Zyvw$jotaiutils.useAtomCallback)((0, $5Zyvw$react.useCallback)(async (_get, set)=>{
|
|
479
533
|
if (!client) return;
|
|
480
534
|
const availableCams = await client.getAllCams();
|
|
481
535
|
const availableMics = await client.getAllMics();
|
|
482
536
|
const availableSpeakers = await client.getAllSpeakers();
|
|
483
|
-
set($
|
|
484
|
-
set($
|
|
485
|
-
set($
|
|
486
|
-
set($
|
|
487
|
-
set($
|
|
488
|
-
set($
|
|
537
|
+
set($9bd3e7d3a9d7acd1$var$availableCamsAtom, availableCams);
|
|
538
|
+
set($9bd3e7d3a9d7acd1$var$availableMicsAtom, availableMics);
|
|
539
|
+
set($9bd3e7d3a9d7acd1$var$availableSpeakersAtom, availableSpeakers);
|
|
540
|
+
set($9bd3e7d3a9d7acd1$var$selectedCamAtom, client.selectedCam);
|
|
541
|
+
set($9bd3e7d3a9d7acd1$var$selectedMicAtom, client.selectedMic);
|
|
542
|
+
set($9bd3e7d3a9d7acd1$var$selectedSpeakerAtom, client.selectedSpeaker);
|
|
489
543
|
}, [
|
|
490
544
|
client
|
|
491
545
|
]));
|
|
@@ -495,22 +549,22 @@ const $01bcacdf0a25e20c$export$652c54907b83a48d = ()=>{
|
|
|
495
549
|
initDevices
|
|
496
550
|
]);
|
|
497
551
|
(0, $8a6b68ebf0332682$export$33a6ac53b8f02625)((0, $5Zyvw$pipecataiclientjs.RTVIEvent).AvailableCamsUpdated, (0, $5Zyvw$jotaiutils.useAtomCallback)((0, $5Zyvw$react.useCallback)((_get, set, cams)=>{
|
|
498
|
-
set($
|
|
552
|
+
set($9bd3e7d3a9d7acd1$var$availableCamsAtom, cams);
|
|
499
553
|
}, [])));
|
|
500
554
|
(0, $8a6b68ebf0332682$export$33a6ac53b8f02625)((0, $5Zyvw$pipecataiclientjs.RTVIEvent).AvailableMicsUpdated, (0, $5Zyvw$jotaiutils.useAtomCallback)((0, $5Zyvw$react.useCallback)((_get, set, mics)=>{
|
|
501
|
-
set($
|
|
555
|
+
set($9bd3e7d3a9d7acd1$var$availableMicsAtom, mics);
|
|
502
556
|
}, [])));
|
|
503
557
|
(0, $8a6b68ebf0332682$export$33a6ac53b8f02625)((0, $5Zyvw$pipecataiclientjs.RTVIEvent).AvailableSpeakersUpdated, (0, $5Zyvw$jotaiutils.useAtomCallback)((0, $5Zyvw$react.useCallback)((_get, set, speakers)=>{
|
|
504
|
-
set($
|
|
558
|
+
set($9bd3e7d3a9d7acd1$var$availableSpeakersAtom, speakers);
|
|
505
559
|
}, [])));
|
|
506
560
|
(0, $8a6b68ebf0332682$export$33a6ac53b8f02625)((0, $5Zyvw$pipecataiclientjs.RTVIEvent).CamUpdated, (0, $5Zyvw$jotaiutils.useAtomCallback)((0, $5Zyvw$react.useCallback)((_get, set, cam)=>{
|
|
507
|
-
set($
|
|
561
|
+
set($9bd3e7d3a9d7acd1$var$selectedCamAtom, cam);
|
|
508
562
|
}, [])));
|
|
509
563
|
(0, $8a6b68ebf0332682$export$33a6ac53b8f02625)((0, $5Zyvw$pipecataiclientjs.RTVIEvent).MicUpdated, (0, $5Zyvw$jotaiutils.useAtomCallback)((0, $5Zyvw$react.useCallback)((_get, set, mic)=>{
|
|
510
|
-
set($
|
|
564
|
+
set($9bd3e7d3a9d7acd1$var$selectedMicAtom, mic);
|
|
511
565
|
}, [])));
|
|
512
566
|
(0, $8a6b68ebf0332682$export$33a6ac53b8f02625)((0, $5Zyvw$pipecataiclientjs.RTVIEvent).SpeakerUpdated, (0, $5Zyvw$jotaiutils.useAtomCallback)((0, $5Zyvw$react.useCallback)((_get, set, speaker)=>{
|
|
513
|
-
set($
|
|
567
|
+
set($9bd3e7d3a9d7acd1$var$selectedSpeakerAtom, speaker);
|
|
514
568
|
}, [])));
|
|
515
569
|
const updateCam = (0, $5Zyvw$react.useCallback)((id)=>{
|
|
516
570
|
client?.updateCam(id);
|
|
@@ -547,9 +601,10 @@ const $01bcacdf0a25e20c$export$652c54907b83a48d = ()=>{
|
|
|
547
601
|
|
|
548
602
|
|
|
549
603
|
|
|
604
|
+
|
|
550
605
|
const $a1dfa75b13e6bb9b$export$59bf27bd43679db6 = /*#__PURE__*/ (0, ($parcel$interopDefault($5Zyvw$react))).memo(({ backgroundColor: backgroundColor = "transparent", barColor: barColor = "black", barCount: barCount = 5, barGap: barGap = 12, barLineCap: barLineCap = "round", barMaxHeight: barMaxHeight = 120, barOrigin: barOrigin = "center", barWidth: barWidth = 30, participantType: participantType })=>{
|
|
551
606
|
const canvasRef = (0, $5Zyvw$react.useRef)(null);
|
|
552
|
-
const track = (0, $
|
|
607
|
+
const track = (0, $630203d8dad1dd45$export$9813dcd2d0c26814)("audio", participantType);
|
|
553
608
|
(0, $5Zyvw$react.useEffect)(()=>{
|
|
554
609
|
if (!canvasRef.current) return;
|
|
555
610
|
const canvasWidth = barCount * barWidth + (barCount - 1) * barGap;
|