@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.
@@ -1576,7 +1576,12 @@ function DialtribeStreamer({
1576
1576
  const audioInputs = devices.filter((device) => device.kind === "audioinput");
1577
1577
  console.log(`\u{1F4F7} Found ${videoInputs.length} video input device(s)`);
1578
1578
  console.log(`\u{1F3A4} Found ${audioInputs.length} audio input device(s)`);
1579
- setHasMultipleCameras(videoInputs.length > 1);
1579
+ const isIOS = /iPad|iPhone|iPod/.test(navigator.userAgent) || navigator.platform === "MacIntel" && navigator.maxTouchPoints > 1;
1580
+ const hasMultiple = videoInputs.length > 1 || isIOS && isVideoKey;
1581
+ setHasMultipleCameras(hasMultiple);
1582
+ if (isIOS && videoInputs.length <= 1) {
1583
+ console.log("\u{1F4F1} iOS device detected - assuming multiple cameras available");
1584
+ }
1580
1585
  setVideoDevices(videoInputs.map((d) => ({
1581
1586
  deviceId: d.deviceId,
1582
1587
  label: d.label || `Camera ${d.deviceId.slice(0, 8)}`
@@ -1593,7 +1598,8 @@ function DialtribeStreamer({
1593
1598
  }
1594
1599
  } catch (err) {
1595
1600
  console.error("\u274C Failed to enumerate devices:", err);
1596
- setHasMultipleCameras(false);
1601
+ const isIOS = /iPad|iPhone|iPod/.test(navigator.userAgent) || navigator.platform === "MacIntel" && navigator.maxTouchPoints > 1;
1602
+ setHasMultipleCameras(isIOS && isVideoKey);
1597
1603
  }
1598
1604
  };
1599
1605
  useEffect(() => {
@@ -1627,7 +1633,7 @@ function DialtribeStreamer({
1627
1633
  if (videoRef.current && mediaStream) {
1628
1634
  videoRef.current.srcObject = mediaStream;
1629
1635
  }
1630
- }, [mediaStream]);
1636
+ }, [mediaStream, isVideoEnabled]);
1631
1637
  const requestMediaPermissions = async () => {
1632
1638
  if (!streamKey) return;
1633
1639
  try {