lazy_scroll_video 0.1.1 → 0.1.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.
- checksums.yaml +4 -4
- data/lib/lazy_scroll_video/version.rb +1 -1
- data/vendor/assets/javascripts/lazy_scroll_video.js +11 -4
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 3c70e6233ce70798c65be1d5a1f99779c2878413c21848f9c958a19c4e8573a0
|
|
4
|
+
data.tar.gz: e775bd49f3950d593d06182c678f382f4a526d47ca8ad515960e8476a3579721
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: e2d4f64cbdd66b5712d9a90c4803c720ad0dbc47276669595c8462dca340711adb036b0fbfdaa4c64dc956e29138f0d9cb0fcc9e35027b9a4a3ceda1c9e97988
|
|
7
|
+
data.tar.gz: 5d67fc18c4df5f5e5c03e9cb178f9e27b7af85cd567bfaeaa2618e32b46c35a8cb1a4ba7991339a5265ce71b9dc485a9ac286ff6ab7d4581d201136828b0bb88
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
(function () {
|
|
2
|
-
|
|
2
|
+
function initLazyVideoContainers() {
|
|
3
3
|
console.log('initiating lazy scroll video');
|
|
4
|
+
|
|
4
5
|
const observer = new IntersectionObserver((entries, obs) => {
|
|
5
6
|
entries.forEach(entry => {
|
|
6
7
|
if (entry.isIntersecting) {
|
|
@@ -11,7 +12,7 @@
|
|
|
11
12
|
video.src = videoSrc;
|
|
12
13
|
video.controls = true;
|
|
13
14
|
video.autoplay = false;
|
|
14
|
-
video.muted = true;
|
|
15
|
+
video.muted = true;
|
|
15
16
|
video.playsInline = true;
|
|
16
17
|
video.style.width = "100%";
|
|
17
18
|
video.style.height = "100%";
|
|
@@ -29,5 +30,11 @@
|
|
|
29
30
|
console.log('initiating content observer');
|
|
30
31
|
observer.observe(container);
|
|
31
32
|
});
|
|
32
|
-
}
|
|
33
|
-
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
// Auto-init on DOMContentLoaded
|
|
36
|
+
document.addEventListener("DOMContentLoaded", initLazyVideoContainers);
|
|
37
|
+
|
|
38
|
+
// Expose to global scope for manual use
|
|
39
|
+
window.initLazyVideoContainers = initLazyVideoContainers;
|
|
40
|
+
})();
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: lazy_scroll_video
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Prosenjit Chongder
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2025-
|
|
11
|
+
date: 2025-09-26 00:00:00.000000000 Z
|
|
12
12
|
dependencies: []
|
|
13
13
|
description: A small JS gem for lazy-loading videos into view for Rails apps.
|
|
14
14
|
email:
|