@xhub-reels/sdk 0.1.21 → 0.1.22
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.cjs +12 -16
- package/dist/index.js +12 -16
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -2052,7 +2052,7 @@ function VideoSlotInner({
|
|
|
2052
2052
|
inset: 0,
|
|
2053
2053
|
backgroundImage: `url(${item.poster})`,
|
|
2054
2054
|
backgroundSize: "cover",
|
|
2055
|
-
backgroundPosition: "center",
|
|
2055
|
+
backgroundPosition: "center center",
|
|
2056
2056
|
opacity: showPosterOverlay ? 1 : 0,
|
|
2057
2057
|
transition: "opacity 0.15s ease",
|
|
2058
2058
|
pointerEvents: "none"
|
|
@@ -2919,16 +2919,12 @@ function transformVideoItem(raw) {
|
|
|
2919
2919
|
const stats = transformStats(obj);
|
|
2920
2920
|
const interaction = transformInteraction(obj);
|
|
2921
2921
|
let poster;
|
|
2922
|
-
|
|
2923
|
-
|
|
2924
|
-
|
|
2925
|
-
|
|
2926
|
-
|
|
2927
|
-
|
|
2928
|
-
if (Array.isArray(mediaArr2) && mediaArr2.length > 0) {
|
|
2929
|
-
const first = mediaArr2[0];
|
|
2930
|
-
poster = toStr(first["poster"], "") || void 0;
|
|
2931
|
-
}
|
|
2922
|
+
let duration = 0;
|
|
2923
|
+
const mediaArr = obj["media"];
|
|
2924
|
+
if (Array.isArray(mediaArr) && mediaArr.length > 0) {
|
|
2925
|
+
const first = mediaArr[0];
|
|
2926
|
+
poster = toStr(first["poster"], "") || void 0;
|
|
2927
|
+
duration = toNum(first["duration"], 0);
|
|
2932
2928
|
}
|
|
2933
2929
|
if (!poster) {
|
|
2934
2930
|
poster = toStr(
|
|
@@ -2936,11 +2932,11 @@ function transformVideoItem(raw) {
|
|
|
2936
2932
|
void 0
|
|
2937
2933
|
) || void 0;
|
|
2938
2934
|
}
|
|
2939
|
-
|
|
2940
|
-
|
|
2941
|
-
|
|
2942
|
-
|
|
2943
|
-
|
|
2935
|
+
if (!poster) {
|
|
2936
|
+
const thumbnailObj = obj["thumbnail"];
|
|
2937
|
+
if (thumbnailObj && thumbnailObj["url"]) {
|
|
2938
|
+
poster = toStr(thumbnailObj["url"], "") || void 0;
|
|
2939
|
+
}
|
|
2944
2940
|
}
|
|
2945
2941
|
if (duration === 0) {
|
|
2946
2942
|
duration = toNum(tryFields(obj, "duration", "duration_seconds", "length", "video_duration"), 0);
|
package/dist/index.js
CHANGED
|
@@ -2046,7 +2046,7 @@ function VideoSlotInner({
|
|
|
2046
2046
|
inset: 0,
|
|
2047
2047
|
backgroundImage: `url(${item.poster})`,
|
|
2048
2048
|
backgroundSize: "cover",
|
|
2049
|
-
backgroundPosition: "center",
|
|
2049
|
+
backgroundPosition: "center center",
|
|
2050
2050
|
opacity: showPosterOverlay ? 1 : 0,
|
|
2051
2051
|
transition: "opacity 0.15s ease",
|
|
2052
2052
|
pointerEvents: "none"
|
|
@@ -2913,16 +2913,12 @@ function transformVideoItem(raw) {
|
|
|
2913
2913
|
const stats = transformStats(obj);
|
|
2914
2914
|
const interaction = transformInteraction(obj);
|
|
2915
2915
|
let poster;
|
|
2916
|
-
|
|
2917
|
-
|
|
2918
|
-
|
|
2919
|
-
|
|
2920
|
-
|
|
2921
|
-
|
|
2922
|
-
if (Array.isArray(mediaArr2) && mediaArr2.length > 0) {
|
|
2923
|
-
const first = mediaArr2[0];
|
|
2924
|
-
poster = toStr(first["poster"], "") || void 0;
|
|
2925
|
-
}
|
|
2916
|
+
let duration = 0;
|
|
2917
|
+
const mediaArr = obj["media"];
|
|
2918
|
+
if (Array.isArray(mediaArr) && mediaArr.length > 0) {
|
|
2919
|
+
const first = mediaArr[0];
|
|
2920
|
+
poster = toStr(first["poster"], "") || void 0;
|
|
2921
|
+
duration = toNum(first["duration"], 0);
|
|
2926
2922
|
}
|
|
2927
2923
|
if (!poster) {
|
|
2928
2924
|
poster = toStr(
|
|
@@ -2930,11 +2926,11 @@ function transformVideoItem(raw) {
|
|
|
2930
2926
|
void 0
|
|
2931
2927
|
) || void 0;
|
|
2932
2928
|
}
|
|
2933
|
-
|
|
2934
|
-
|
|
2935
|
-
|
|
2936
|
-
|
|
2937
|
-
|
|
2929
|
+
if (!poster) {
|
|
2930
|
+
const thumbnailObj = obj["thumbnail"];
|
|
2931
|
+
if (thumbnailObj && thumbnailObj["url"]) {
|
|
2932
|
+
poster = toStr(thumbnailObj["url"], "") || void 0;
|
|
2933
|
+
}
|
|
2938
2934
|
}
|
|
2939
2935
|
if (duration === 0) {
|
|
2940
2936
|
duration = toNum(tryFields(obj, "duration", "duration_seconds", "length", "video_duration"), 0);
|