@stream-io/video-react-sdk 1.37.0 → 1.37.2

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/index.es.js CHANGED
@@ -1399,7 +1399,7 @@ const SpeakerTest = (props) => {
1399
1399
  const audioElementRef = useRef(null);
1400
1400
  const [isPlaying, setIsPlaying] = useState(false);
1401
1401
  const { t } = useI18n();
1402
- const { audioUrl = `https://unpkg.com/${"@stream-io/video-react-sdk"}@${"1.37.0"}/assets/piano.mp3`, } = props;
1402
+ const { audioUrl = `https://unpkg.com/${"@stream-io/video-react-sdk"}@${"1.37.2"}/assets/piano.mp3`, } = props;
1403
1403
  // Update audio output device when selection changes
1404
1404
  useEffect(() => {
1405
1405
  const audio = audioElementRef.current;
@@ -2836,7 +2836,19 @@ const BackstageLayout = (props) => {
2836
2836
  const participantCount = useParticipantCount();
2837
2837
  const startsAt = useCallStartsAt();
2838
2838
  const { t } = useI18n();
2839
- return (jsx("div", { className: "str-video__livestream-layout__wrapper", children: jsxs("div", { className: "str-video__livestream-layout__backstage", children: [startsAt && (jsx("span", { className: "str-video__livestream-layout__starts-at", children: startsAt.getTime() < Date.now()
2839
+ const [startsAtPassed, setStartsAtPassed] = useState(() => !!startsAt && startsAt.getTime() < Date.now());
2840
+ useEffect(() => {
2841
+ if (!startsAt || startsAtPassed)
2842
+ return;
2843
+ const check = () => {
2844
+ if (startsAt.getTime() < Date.now()) {
2845
+ setStartsAtPassed(true);
2846
+ }
2847
+ };
2848
+ const interval = setInterval(check, 1000);
2849
+ return () => clearInterval(interval);
2850
+ }, [startsAt, startsAtPassed]);
2851
+ return (jsx("div", { className: "str-video__livestream-layout__wrapper", children: jsxs("div", { className: "str-video__livestream-layout__backstage", children: [startsAt && (jsx("span", { className: "str-video__livestream-layout__starts-at", children: startsAtPassed
2840
2852
  ? t('Livestream starts soon')
2841
2853
  : t('Livestream starts at {{ time }}', {
2842
2854
  time: startsAt.toLocaleTimeString([], {
@@ -3252,7 +3264,7 @@ const checkCanJoinEarly = (startsAt, joinAheadTimeSeconds) => {
3252
3264
  return Date.now() >= +startsAt - (joinAheadTimeSeconds ?? 0) * 1000;
3253
3265
  };
3254
3266
 
3255
- const [major, minor, patch] = ("1.37.0").split('.');
3267
+ const [major, minor, patch] = ("1.37.2").split('.');
3256
3268
  setSdkInfo({
3257
3269
  type: SfuModels.SdkType.REACT,
3258
3270
  major,