Play videos based on scroll position
- Source:
Members
(private, static) scrollListenerAdded :bool
Check to see if scroll-listener has been added
- Type:
- bool
- Source:
- Type:
- number
- Source:
- Type:
- array
- Source:
- Source:
- Source:
- Source:
- Source:
- Source:
(private, static, constant) threshold :number
The threshold for when videos in view should be played
(private, static) videos :array
The array for all the videos to be played
Methods
(private, static) bindScroll()
Bind scroll-listener
(private, static) findVideos()
Find videos in document that haven't been played yet
(static) init()
Initialize the component
(private, static) playVideosInView()
Plays a video with data-video-defer="view"
attribute if it's within the viewport threshold
(static) reflow()
Reflow the component