@swipefindercom/finder-sdk 1.0.23 → 1.0.25

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.
@@ -23582,6 +23582,19 @@ const VideoWrapper = ({
23582
23582
  }
23583
23583
  }
23584
23584
  }, [isMuted, volume, ready]);
23585
+ useEffect(() => {
23586
+ const video = videoRef.current;
23587
+ if (!video || !ready) return;
23588
+ const handlePlaying = () => {
23589
+ if (!isMuted && video.muted) {
23590
+ video.muted = false;
23591
+ }
23592
+ };
23593
+ video.addEventListener("playing", handlePlaying);
23594
+ return () => {
23595
+ video.removeEventListener("playing", handlePlaying);
23596
+ };
23597
+ }, [isMuted, ready]);
23585
23598
  const preload = cardIndex === 0 ? "auto" : "none";
23586
23599
  return /* @__PURE__ */ jsx(Fragment$1, { children: card2.videoUrl && ready && /* @__PURE__ */ jsx("div", { className: styles$m.videoContainer, children: /* @__PURE__ */ jsx(
23587
23600
  ReactHlsPlayer,
@@ -25032,6 +25045,10 @@ const SwipeableFeed = ({
25032
25045
  const [isCardReady, setIsCardReady] = useState({});
25033
25046
  const [tutorialXOffset, setTutorialXOffset] = useState(0);
25034
25047
  const containerRef = useRef(null);
25048
+ const isMutedRef = useRef(isMuted);
25049
+ useEffect(() => {
25050
+ isMutedRef.current = isMuted;
25051
+ }, [isMuted]);
25035
25052
  const finishTutorial = useCallback(() => {
25036
25053
  setTutorialXOffset(0);
25037
25054
  hideTutorial == null ? void 0 : hideTutorial();
@@ -25070,6 +25087,7 @@ const SwipeableFeed = ({
25070
25087
  if (video.play) {
25071
25088
  await video.play();
25072
25089
  }
25090
+ video.muted = isMutedRef.current;
25073
25091
  } catch (error) {
25074
25092
  if (retryCount < maxRetries) {
25075
25093
  retryCount++;
@@ -26645,11 +26663,18 @@ const AppStateProvider = ({
26645
26663
  const [allCards, setAllCards] = useState([]);
26646
26664
  const [filteredCards, setFilteredCards] = useState([]);
26647
26665
  const [selectedCategories, setSelectedCategories] = useState([]);
26666
+ const [isInitialMute, setIsInitialMute] = useState(true);
26648
26667
  useEffect(() => {
26649
26668
  if (isInitiallyLoaded && finder) {
26650
26669
  setVolume(finder.initialVolume);
26651
26670
  }
26652
26671
  }, [isInitiallyLoaded, finder]);
26672
+ useEffect(() => {
26673
+ if (currentCardIndex > 0 && isInitialMute && isMuted) {
26674
+ setIsMuted(false);
26675
+ setIsInitialMute(false);
26676
+ }
26677
+ }, [currentCardIndex, isInitialMute, isMuted]);
26653
26678
  const addSwipeToHistory = useCallback((direction, card2) => {
26654
26679
  setSwipeHistory((prev) => {
26655
26680
  const existingEntryIndex = prev.findIndex(
@@ -26671,6 +26696,7 @@ const AppStateProvider = ({
26671
26696
  return swipeHistory.filter((entry) => entry.direction === direction).map((entry) => entry.card);
26672
26697
  }, [swipeHistory]);
26673
26698
  const toggleMute = useCallback(() => {
26699
+ setIsInitialMute(false);
26674
26700
  setIsMuted((prev) => !prev);
26675
26701
  }, []);
26676
26702
  const handleVolumeChange = useCallback((newVolume) => {