@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.js
CHANGED
|
@@ -3169,7 +3169,12 @@ function DialtribeStreamer({
|
|
|
3169
3169
|
const audioInputs = devices.filter((device) => device.kind === "audioinput");
|
|
3170
3170
|
console.log(`\u{1F4F7} Found ${videoInputs.length} video input device(s)`);
|
|
3171
3171
|
console.log(`\u{1F3A4} Found ${audioInputs.length} audio input device(s)`);
|
|
3172
|
-
|
|
3172
|
+
const isIOS = /iPad|iPhone|iPod/.test(navigator.userAgent) || navigator.platform === "MacIntel" && navigator.maxTouchPoints > 1;
|
|
3173
|
+
const hasMultiple = videoInputs.length > 1 || isIOS && isVideoKey;
|
|
3174
|
+
setHasMultipleCameras(hasMultiple);
|
|
3175
|
+
if (isIOS && videoInputs.length <= 1) {
|
|
3176
|
+
console.log("\u{1F4F1} iOS device detected - assuming multiple cameras available");
|
|
3177
|
+
}
|
|
3173
3178
|
setVideoDevices(videoInputs.map((d) => ({
|
|
3174
3179
|
deviceId: d.deviceId,
|
|
3175
3180
|
label: d.label || `Camera ${d.deviceId.slice(0, 8)}`
|
|
@@ -3186,7 +3191,8 @@ function DialtribeStreamer({
|
|
|
3186
3191
|
}
|
|
3187
3192
|
} catch (err) {
|
|
3188
3193
|
console.error("\u274C Failed to enumerate devices:", err);
|
|
3189
|
-
|
|
3194
|
+
const isIOS = /iPad|iPhone|iPod/.test(navigator.userAgent) || navigator.platform === "MacIntel" && navigator.maxTouchPoints > 1;
|
|
3195
|
+
setHasMultipleCameras(isIOS && isVideoKey);
|
|
3190
3196
|
}
|
|
3191
3197
|
};
|
|
3192
3198
|
React2.useEffect(() => {
|
|
@@ -3220,7 +3226,7 @@ function DialtribeStreamer({
|
|
|
3220
3226
|
if (videoRef.current && mediaStream) {
|
|
3221
3227
|
videoRef.current.srcObject = mediaStream;
|
|
3222
3228
|
}
|
|
3223
|
-
}, [mediaStream]);
|
|
3229
|
+
}, [mediaStream, isVideoEnabled]);
|
|
3224
3230
|
const requestMediaPermissions = async () => {
|
|
3225
3231
|
if (!streamKey) return;
|
|
3226
3232
|
try {
|