@swipefindercom/finder-sdk 1.0.23 → 1.0.24

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,
@@ -25070,6 +25083,7 @@ const SwipeableFeed = ({
25070
25083
  if (video.play) {
25071
25084
  await video.play();
25072
25085
  }
25086
+ video.muted = isMuted;
25073
25087
  } catch (error) {
25074
25088
  if (retryCount < maxRetries) {
25075
25089
  retryCount++;
@@ -25086,7 +25100,7 @@ const SwipeableFeed = ({
25086
25100
  } catch (error) {
25087
25101
  console.warn("Video playback setup error:", error);
25088
25102
  }
25089
- }, []);
25103
+ }, [isMuted]);
25090
25104
  const displayedCards = useMemo(() => {
25091
25105
  return cards.slice(currentCardIndex, currentCardIndex + maxVisibleCards);
25092
25106
  }, [cards, currentCardIndex, maxVisibleCards]);
@@ -26645,11 +26659,18 @@ const AppStateProvider = ({
26645
26659
  const [allCards, setAllCards] = useState([]);
26646
26660
  const [filteredCards, setFilteredCards] = useState([]);
26647
26661
  const [selectedCategories, setSelectedCategories] = useState([]);
26662
+ const [isInitialMute, setIsInitialMute] = useState(true);
26648
26663
  useEffect(() => {
26649
26664
  if (isInitiallyLoaded && finder) {
26650
26665
  setVolume(finder.initialVolume);
26651
26666
  }
26652
26667
  }, [isInitiallyLoaded, finder]);
26668
+ useEffect(() => {
26669
+ if (currentCardIndex > 0 && isInitialMute && isMuted) {
26670
+ setIsMuted(false);
26671
+ setIsInitialMute(false);
26672
+ }
26673
+ }, [currentCardIndex, isInitialMute, isMuted]);
26653
26674
  const addSwipeToHistory = useCallback((direction, card2) => {
26654
26675
  setSwipeHistory((prev) => {
26655
26676
  const existingEntryIndex = prev.findIndex(
@@ -26671,6 +26692,7 @@ const AppStateProvider = ({
26671
26692
  return swipeHistory.filter((entry) => entry.direction === direction).map((entry) => entry.card);
26672
26693
  }, [swipeHistory]);
26673
26694
  const toggleMute = useCallback(() => {
26695
+ setIsInitialMute(false);
26674
26696
  setIsMuted((prev) => !prev);
26675
26697
  }, []);
26676
26698
  const handleVolumeChange = useCallback((newVolume) => {