@stokr/components-library 3.0.60 → 3.0.61
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.
|
@@ -2,6 +2,10 @@ import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
|
2
2
|
import styled from "styled-components";
|
|
3
3
|
import { useRef, useState, useCallback, useEffect } from "react";
|
|
4
4
|
import { useInView } from "react-intersection-observer";
|
|
5
|
+
const ViewportWrapper = styled.div`
|
|
6
|
+
width: 100%;
|
|
7
|
+
height: 100%;
|
|
8
|
+
`;
|
|
5
9
|
const VideoContainer = styled.div`
|
|
6
10
|
position: relative;
|
|
7
11
|
width: 100%;
|
|
@@ -21,7 +25,7 @@ const CLOUDINARY_VERSION = "v1745923531";
|
|
|
21
25
|
const CLOUDINARY_PUBLIC_ID = "Static/Hero_section_video_kuatj1";
|
|
22
26
|
const VIDEO_SRC_DESKTOP = `${CLOUDINARY_BASE}/f_auto,q_auto:good,vc_auto,w_1920,c_limit/${CLOUDINARY_VERSION}/${CLOUDINARY_PUBLIC_ID}.mp4`;
|
|
23
27
|
const VIDEO_SRC_MOBILE = `${CLOUDINARY_BASE}/f_auto,q_auto:good,vc_auto,w_1280,c_limit/${CLOUDINARY_VERSION}/${CLOUDINARY_PUBLIC_ID}.mp4`;
|
|
24
|
-
const VIDEO_POSTER = `${CLOUDINARY_BASE}/
|
|
28
|
+
const VIDEO_POSTER = `${CLOUDINARY_BASE}/so_auto,f_jpg,q_auto:good,w_1920,c_limit/${CLOUDINARY_VERSION}/${CLOUDINARY_PUBLIC_ID}.jpg`;
|
|
25
29
|
const shouldLoadVideo = () => {
|
|
26
30
|
if (typeof navigator === "undefined") return true;
|
|
27
31
|
const conn = navigator.connection || navigator.mozConnection || navigator.webkitConnection;
|
|
@@ -105,7 +109,7 @@ const HeroVideoBlock = () => {
|
|
|
105
109
|
document.removeEventListener("visibilitychange", handleDocVisibilityChange);
|
|
106
110
|
};
|
|
107
111
|
}, [playVideo]);
|
|
108
|
-
return /* @__PURE__ */ jsx(
|
|
112
|
+
return /* @__PURE__ */ jsx(ViewportWrapper, { ref: windowViewportRef, children: /* @__PURE__ */ jsx(VideoContainer, { children: /* @__PURE__ */ jsx(
|
|
109
113
|
VideoBackground,
|
|
110
114
|
{
|
|
111
115
|
ref: videoRef,
|