@quintype/components 3.4.4-infiniteScroll-videos.5 → 3.4.4
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/cjs/index.js +21 -13
- package/dist/es/components/story-elements/brightcove.js +6 -4
- package/dist/es/components/story-elements/dailymotion-embed-script.js +5 -3
- package/dist/es/components/story-elements/dailymotion.js +5 -3
- package/dist/es/components/story-elements/youtube.js +5 -3
- package/package.json +1 -1
package/dist/cjs/index.js
CHANGED
|
@@ -2402,8 +2402,9 @@ var BrightcoveElement = function BrightcoveElement(props) {
|
|
|
2402
2402
|
setThumbnailClicked = _useState8[1];
|
|
2403
2403
|
|
|
2404
2404
|
var videoRef = React.useRef();
|
|
2405
|
-
var videoPausedByObserver = React.useRef();
|
|
2406
|
-
|
|
2405
|
+
var videoPausedByObserver = React.useRef(); // To check if the video is not click paused by user but paused by intersection observer, Its implemented this way because we cannot capture the click-pause event as videos are playing in iframe
|
|
2406
|
+
|
|
2407
|
+
var observerRef = React.useRef(); // To Observe video element for intersection
|
|
2407
2408
|
|
|
2408
2409
|
var loadLibrary = function loadLibrary() {
|
|
2409
2410
|
var _window;
|
|
@@ -2443,7 +2444,8 @@ var BrightcoveElement = function BrightcoveElement(props) {
|
|
|
2443
2444
|
function intersectionCallback(entries) {
|
|
2444
2445
|
var videoInViewPort = entries === null || entries === void 0 ? void 0 : entries[0].isIntersecting;
|
|
2445
2446
|
if (videoInViewPort) myPlayer.play();else {
|
|
2446
|
-
videoPausedByObserver.current = true;
|
|
2447
|
+
videoPausedByObserver.current = true; // before the below line fires the pause event we set the videoPausedByObserver Ref to true, this lets the pause events callback to know that the video is not click-paused by the user but paused by the intersection observer
|
|
2448
|
+
|
|
2447
2449
|
myPlayer.pause();
|
|
2448
2450
|
}
|
|
2449
2451
|
}
|
|
@@ -2465,7 +2467,7 @@ var BrightcoveElement = function BrightcoveElement(props) {
|
|
|
2465
2467
|
var isVideoPausedByObserver = videoPausedByObserver.current;
|
|
2466
2468
|
|
|
2467
2469
|
if (isVideoPausedByObserver) {
|
|
2468
|
-
videoPausedByObserver.current = false;
|
|
2470
|
+
videoPausedByObserver.current = false; // This is a clean up to set videoPausedByObserver back to false
|
|
2469
2471
|
} else {
|
|
2470
2472
|
disconnectObserver(observer);
|
|
2471
2473
|
}
|
|
@@ -2654,7 +2656,7 @@ var CustomStoryElementDailyMotion = /*#__PURE__*/function (_React$Component) {
|
|
|
2654
2656
|
var videoPausedByObserver = _this.videoPausedByObserver.current;
|
|
2655
2657
|
|
|
2656
2658
|
if (videoPausedByObserver) {
|
|
2657
|
-
_this.videoPausedByObserver.current = false;
|
|
2659
|
+
_this.videoPausedByObserver.current = false; // This is a clean up to set videoPausedByObserver back to false
|
|
2658
2660
|
} else {
|
|
2659
2661
|
disconnectObserver(_this.intersectionObserver);
|
|
2660
2662
|
}
|
|
@@ -2664,7 +2666,8 @@ var CustomStoryElementDailyMotion = /*#__PURE__*/function (_React$Component) {
|
|
|
2664
2666
|
var player = _this.videoRef.current;
|
|
2665
2667
|
var videoInVewPort = entries === null || entries === void 0 ? void 0 : entries[0].isIntersecting;
|
|
2666
2668
|
if (videoInVewPort) player.play();else {
|
|
2667
|
-
_this.videoPausedByObserver.current = true;
|
|
2669
|
+
_this.videoPausedByObserver.current = true; // before the below line fires the pause event we set the videoPausedByObserver Ref to true, this lets the pause events callback to know that the video is not click-paused by the user but paused by the intersection observer
|
|
2670
|
+
|
|
2668
2671
|
player.pause();
|
|
2669
2672
|
}
|
|
2670
2673
|
});
|
|
@@ -2707,7 +2710,8 @@ var CustomStoryElementDailyMotion = /*#__PURE__*/function (_React$Component) {
|
|
|
2707
2710
|
}
|
|
2708
2711
|
};
|
|
2709
2712
|
_this.videoRef = /*#__PURE__*/React__default["default"].createRef();
|
|
2710
|
-
_this.videoPausedByObserver = /*#__PURE__*/React__default["default"].createRef();
|
|
2713
|
+
_this.videoPausedByObserver = /*#__PURE__*/React__default["default"].createRef(); // To check if the video is not click paused by user but paused by intersection observer, Its implemented this way because we cannot capture the click-pause event as videos are playing in iframe
|
|
2714
|
+
|
|
2711
2715
|
return _this;
|
|
2712
2716
|
}
|
|
2713
2717
|
|
|
@@ -2809,7 +2813,8 @@ var DailyMotion = /*#__PURE__*/function (_React$Component) {
|
|
|
2809
2813
|
var videoInVewPort = entries === null || entries === void 0 ? void 0 : entries[0].isIntersecting;
|
|
2810
2814
|
var player = _this.state.dmPlayer;
|
|
2811
2815
|
if (videoInVewPort) player.play();else {
|
|
2812
|
-
_this.videoPausedByObserver.current = true;
|
|
2816
|
+
_this.videoPausedByObserver.current = true; // before the below line fires the pause event we set the videoPausedByObserver Ref to true, this lets the pause events callback to know that the video is not click-paused by the user but paused by the intersection observer
|
|
2817
|
+
|
|
2813
2818
|
player.pause();
|
|
2814
2819
|
}
|
|
2815
2820
|
});
|
|
@@ -2828,7 +2833,7 @@ var DailyMotion = /*#__PURE__*/function (_React$Component) {
|
|
|
2828
2833
|
var isVideoPausedByObserver = _this.videoPausedByObserver.current;
|
|
2829
2834
|
|
|
2830
2835
|
if (isVideoPausedByObserver) {
|
|
2831
|
-
_this.videoPausedByObserver.current = false;
|
|
2836
|
+
_this.videoPausedByObserver.current = false; // This is a clean up to set videoPausedByObserver back to false
|
|
2832
2837
|
} else {
|
|
2833
2838
|
disconnectObserver(_this.intersectionObserver);
|
|
2834
2839
|
}
|
|
@@ -2860,7 +2865,8 @@ var DailyMotion = /*#__PURE__*/function (_React$Component) {
|
|
|
2860
2865
|
|
|
2861
2866
|
_this.containerRef = /*#__PURE__*/React__default["default"].createRef();
|
|
2862
2867
|
_this.observerRef = /*#__PURE__*/React__default["default"].createRef();
|
|
2863
|
-
_this.videoPausedByObserver = /*#__PURE__*/React__default["default"].createRef();
|
|
2868
|
+
_this.videoPausedByObserver = /*#__PURE__*/React__default["default"].createRef(); // To check if the video is not click paused by user but paused by intersection observer, Its implemented this way because we cannot capture the click-pause event as videos are playing in iframe
|
|
2869
|
+
|
|
2864
2870
|
_this.state = {
|
|
2865
2871
|
showVideo: false,
|
|
2866
2872
|
dmPlayer: null
|
|
@@ -3288,7 +3294,8 @@ var CustomStoryElementYoutube = /*#__PURE__*/function (_React$Component) {
|
|
|
3288
3294
|
var videoInVewPort = entries === null || entries === void 0 ? void 0 : entries[0].isIntersecting;
|
|
3289
3295
|
var player = _this.videoRef.current;
|
|
3290
3296
|
if (videoInVewPort) player.playVideo();else {
|
|
3291
|
-
_this.videoPausedByObserver.current = true;
|
|
3297
|
+
_this.videoPausedByObserver.current = true; // before the below line fires the pause event we set the videoPausedByObserver Ref to true, this lets the pause events callback to know that the video is not click-paused by the user but paused by the intersection observer
|
|
3298
|
+
|
|
3292
3299
|
player.pauseVideo();
|
|
3293
3300
|
}
|
|
3294
3301
|
});
|
|
@@ -3300,7 +3307,7 @@ var CustomStoryElementYoutube = /*#__PURE__*/function (_React$Component) {
|
|
|
3300
3307
|
var videoPausedByObserver = _this.videoPausedByObserver.current;
|
|
3301
3308
|
|
|
3302
3309
|
if (videoPausedByObserver) {
|
|
3303
|
-
_this.videoPausedByObserver.current = false;
|
|
3310
|
+
_this.videoPausedByObserver.current = false; // This is a clean up to set videoPausedByObserver back to false
|
|
3304
3311
|
} else {
|
|
3305
3312
|
disconnectObserver(_this.intersectionObserver);
|
|
3306
3313
|
}
|
|
@@ -3341,7 +3348,8 @@ var CustomStoryElementYoutube = /*#__PURE__*/function (_React$Component) {
|
|
|
3341
3348
|
}
|
|
3342
3349
|
};
|
|
3343
3350
|
_this.videoRef = /*#__PURE__*/React__default["default"].createRef();
|
|
3344
|
-
_this.videoPausedByObserver = /*#__PURE__*/React__default["default"].createRef();
|
|
3351
|
+
_this.videoPausedByObserver = /*#__PURE__*/React__default["default"].createRef(); // To check if the video is not click paused by user but paused by intersection observer, Its implemented this way because we cannot capture the click-pause event as videos are playing in iframe
|
|
3352
|
+
|
|
3345
3353
|
return _this;
|
|
3346
3354
|
}
|
|
3347
3355
|
|
|
@@ -42,8 +42,9 @@ var BrightcoveElement = function BrightcoveElement(props) {
|
|
|
42
42
|
setThumbnailClicked = _useState8[1];
|
|
43
43
|
|
|
44
44
|
var videoRef = useRef();
|
|
45
|
-
var videoPausedByObserver = useRef();
|
|
46
|
-
|
|
45
|
+
var videoPausedByObserver = useRef(); // To check if the video is not click paused by user but paused by intersection observer, Its implemented this way because we cannot capture the click-pause event as videos are playing in iframe
|
|
46
|
+
|
|
47
|
+
var observerRef = useRef(); // To Observe video element for intersection
|
|
47
48
|
|
|
48
49
|
var loadLibrary = function loadLibrary() {
|
|
49
50
|
var _window;
|
|
@@ -83,7 +84,8 @@ var BrightcoveElement = function BrightcoveElement(props) {
|
|
|
83
84
|
function intersectionCallback(entries) {
|
|
84
85
|
var videoInViewPort = entries === null || entries === void 0 ? void 0 : entries[0].isIntersecting;
|
|
85
86
|
if (videoInViewPort) myPlayer.play();else {
|
|
86
|
-
videoPausedByObserver.current = true;
|
|
87
|
+
videoPausedByObserver.current = true; // before the below line fires the pause event we set the videoPausedByObserver Ref to true, this lets the pause events callback to know that the video is not click-paused by the user but paused by the intersection observer
|
|
88
|
+
|
|
87
89
|
myPlayer.pause();
|
|
88
90
|
}
|
|
89
91
|
}
|
|
@@ -105,7 +107,7 @@ var BrightcoveElement = function BrightcoveElement(props) {
|
|
|
105
107
|
var isVideoPausedByObserver = videoPausedByObserver.current;
|
|
106
108
|
|
|
107
109
|
if (isVideoPausedByObserver) {
|
|
108
|
-
videoPausedByObserver.current = false;
|
|
110
|
+
videoPausedByObserver.current = false; // This is a clean up to set videoPausedByObserver back to false
|
|
109
111
|
} else {
|
|
110
112
|
disconnectObserver(observer);
|
|
111
113
|
}
|
|
@@ -38,7 +38,8 @@ var DailyMotion = /*#__PURE__*/function (_React$Component) {
|
|
|
38
38
|
var videoInVewPort = entries === null || entries === void 0 ? void 0 : entries[0].isIntersecting;
|
|
39
39
|
var player = _this.state.dmPlayer;
|
|
40
40
|
if (videoInVewPort) player.play();else {
|
|
41
|
-
_this.videoPausedByObserver.current = true;
|
|
41
|
+
_this.videoPausedByObserver.current = true; // before the below line fires the pause event we set the videoPausedByObserver Ref to true, this lets the pause events callback to know that the video is not click-paused by the user but paused by the intersection observer
|
|
42
|
+
|
|
42
43
|
player.pause();
|
|
43
44
|
}
|
|
44
45
|
});
|
|
@@ -57,7 +58,7 @@ var DailyMotion = /*#__PURE__*/function (_React$Component) {
|
|
|
57
58
|
var isVideoPausedByObserver = _this.videoPausedByObserver.current;
|
|
58
59
|
|
|
59
60
|
if (isVideoPausedByObserver) {
|
|
60
|
-
_this.videoPausedByObserver.current = false;
|
|
61
|
+
_this.videoPausedByObserver.current = false; // This is a clean up to set videoPausedByObserver back to false
|
|
61
62
|
} else {
|
|
62
63
|
disconnectObserver(_this.intersectionObserver);
|
|
63
64
|
}
|
|
@@ -89,7 +90,8 @@ var DailyMotion = /*#__PURE__*/function (_React$Component) {
|
|
|
89
90
|
|
|
90
91
|
_this.containerRef = /*#__PURE__*/React.createRef();
|
|
91
92
|
_this.observerRef = /*#__PURE__*/React.createRef();
|
|
92
|
-
_this.videoPausedByObserver = /*#__PURE__*/React.createRef();
|
|
93
|
+
_this.videoPausedByObserver = /*#__PURE__*/React.createRef(); // To check if the video is not click paused by user but paused by intersection observer, Its implemented this way because we cannot capture the click-pause event as videos are playing in iframe
|
|
94
|
+
|
|
93
95
|
_this.state = {
|
|
94
96
|
showVideo: false,
|
|
95
97
|
dmPlayer: null
|
|
@@ -76,7 +76,7 @@ var CustomStoryElementDailyMotion = /*#__PURE__*/function (_React$Component) {
|
|
|
76
76
|
var videoPausedByObserver = _this.videoPausedByObserver.current;
|
|
77
77
|
|
|
78
78
|
if (videoPausedByObserver) {
|
|
79
|
-
_this.videoPausedByObserver.current = false;
|
|
79
|
+
_this.videoPausedByObserver.current = false; // This is a clean up to set videoPausedByObserver back to false
|
|
80
80
|
} else {
|
|
81
81
|
disconnectObserver(_this.intersectionObserver);
|
|
82
82
|
}
|
|
@@ -86,7 +86,8 @@ var CustomStoryElementDailyMotion = /*#__PURE__*/function (_React$Component) {
|
|
|
86
86
|
var player = _this.videoRef.current;
|
|
87
87
|
var videoInVewPort = entries === null || entries === void 0 ? void 0 : entries[0].isIntersecting;
|
|
88
88
|
if (videoInVewPort) player.play();else {
|
|
89
|
-
_this.videoPausedByObserver.current = true;
|
|
89
|
+
_this.videoPausedByObserver.current = true; // before the below line fires the pause event we set the videoPausedByObserver Ref to true, this lets the pause events callback to know that the video is not click-paused by the user but paused by the intersection observer
|
|
90
|
+
|
|
90
91
|
player.pause();
|
|
91
92
|
}
|
|
92
93
|
});
|
|
@@ -129,7 +130,8 @@ var CustomStoryElementDailyMotion = /*#__PURE__*/function (_React$Component) {
|
|
|
129
130
|
}
|
|
130
131
|
};
|
|
131
132
|
_this.videoRef = /*#__PURE__*/React.createRef();
|
|
132
|
-
_this.videoPausedByObserver = /*#__PURE__*/React.createRef();
|
|
133
|
+
_this.videoPausedByObserver = /*#__PURE__*/React.createRef(); // To check if the video is not click paused by user but paused by intersection observer, Its implemented this way because we cannot capture the click-pause event as videos are playing in iframe
|
|
134
|
+
|
|
133
135
|
return _this;
|
|
134
136
|
}
|
|
135
137
|
|
|
@@ -107,7 +107,8 @@ var CustomStoryElementYoutube = /*#__PURE__*/function (_React$Component) {
|
|
|
107
107
|
var videoInVewPort = entries === null || entries === void 0 ? void 0 : entries[0].isIntersecting;
|
|
108
108
|
var player = _this.videoRef.current;
|
|
109
109
|
if (videoInVewPort) player.playVideo();else {
|
|
110
|
-
_this.videoPausedByObserver.current = true;
|
|
110
|
+
_this.videoPausedByObserver.current = true; // before the below line fires the pause event we set the videoPausedByObserver Ref to true, this lets the pause events callback to know that the video is not click-paused by the user but paused by the intersection observer
|
|
111
|
+
|
|
111
112
|
player.pauseVideo();
|
|
112
113
|
}
|
|
113
114
|
});
|
|
@@ -119,7 +120,7 @@ var CustomStoryElementYoutube = /*#__PURE__*/function (_React$Component) {
|
|
|
119
120
|
var videoPausedByObserver = _this.videoPausedByObserver.current;
|
|
120
121
|
|
|
121
122
|
if (videoPausedByObserver) {
|
|
122
|
-
_this.videoPausedByObserver.current = false;
|
|
123
|
+
_this.videoPausedByObserver.current = false; // This is a clean up to set videoPausedByObserver back to false
|
|
123
124
|
} else {
|
|
124
125
|
disconnectObserver(_this.intersectionObserver);
|
|
125
126
|
}
|
|
@@ -160,7 +161,8 @@ var CustomStoryElementYoutube = /*#__PURE__*/function (_React$Component) {
|
|
|
160
161
|
}
|
|
161
162
|
};
|
|
162
163
|
_this.videoRef = /*#__PURE__*/React.createRef();
|
|
163
|
-
_this.videoPausedByObserver = /*#__PURE__*/React.createRef();
|
|
164
|
+
_this.videoPausedByObserver = /*#__PURE__*/React.createRef(); // To check if the video is not click paused by user but paused by intersection observer, Its implemented this way because we cannot capture the click-pause event as videos are playing in iframe
|
|
165
|
+
|
|
164
166
|
return _this;
|
|
165
167
|
}
|
|
166
168
|
|