@dialtribe/react-sdk 0.1.0-alpha.15 → 0.1.0-alpha.16
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/dialtribe-streamer.js +9 -3
- package/dist/dialtribe-streamer.js.map +1 -1
- package/dist/dialtribe-streamer.mjs +9 -3
- package/dist/dialtribe-streamer.mjs.map +1 -1
- package/dist/index.js +9 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +9 -3
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -3162,7 +3162,12 @@ function DialtribeStreamer({
|
|
|
3162
3162
|
const audioInputs = devices.filter((device) => device.kind === "audioinput");
|
|
3163
3163
|
console.log(`\u{1F4F7} Found ${videoInputs.length} video input device(s)`);
|
|
3164
3164
|
console.log(`\u{1F3A4} Found ${audioInputs.length} audio input device(s)`);
|
|
3165
|
-
|
|
3165
|
+
const isIOS = /iPad|iPhone|iPod/.test(navigator.userAgent) || navigator.platform === "MacIntel" && navigator.maxTouchPoints > 1;
|
|
3166
|
+
const hasMultiple = videoInputs.length > 1 || isIOS && isVideoKey;
|
|
3167
|
+
setHasMultipleCameras(hasMultiple);
|
|
3168
|
+
if (isIOS && videoInputs.length <= 1) {
|
|
3169
|
+
console.log("\u{1F4F1} iOS device detected - assuming multiple cameras available");
|
|
3170
|
+
}
|
|
3166
3171
|
setVideoDevices(videoInputs.map((d) => ({
|
|
3167
3172
|
deviceId: d.deviceId,
|
|
3168
3173
|
label: d.label || `Camera ${d.deviceId.slice(0, 8)}`
|
|
@@ -3179,7 +3184,8 @@ function DialtribeStreamer({
|
|
|
3179
3184
|
}
|
|
3180
3185
|
} catch (err) {
|
|
3181
3186
|
console.error("\u274C Failed to enumerate devices:", err);
|
|
3182
|
-
|
|
3187
|
+
const isIOS = /iPad|iPhone|iPod/.test(navigator.userAgent) || navigator.platform === "MacIntel" && navigator.maxTouchPoints > 1;
|
|
3188
|
+
setHasMultipleCameras(isIOS && isVideoKey);
|
|
3183
3189
|
}
|
|
3184
3190
|
};
|
|
3185
3191
|
useEffect(() => {
|
|
@@ -3213,7 +3219,7 @@ function DialtribeStreamer({
|
|
|
3213
3219
|
if (videoRef.current && mediaStream) {
|
|
3214
3220
|
videoRef.current.srcObject = mediaStream;
|
|
3215
3221
|
}
|
|
3216
|
-
}, [mediaStream]);
|
|
3222
|
+
}, [mediaStream, isVideoEnabled]);
|
|
3217
3223
|
const requestMediaPermissions = async () => {
|
|
3218
3224
|
if (!streamKey) return;
|
|
3219
3225
|
try {
|