Namespace: videoDefer

db.libs.videoDefer

Play videos based on scroll position

Source:

Members

(private, static) scrollListenerAdded :bool

Check to see if scroll-listener has been added
Type:
bool
Source:

(private, static, constant) threshold :number

The threshold for when videos in view should be played
Type:
number
Source:

(private, static) videos :array

The array for all the videos to be played
Type:
array
Source:

Methods

(private, static) bindScroll()

Bind scroll-listener

Source:

(private, static) findVideos()

Find videos in document that haven't been played yet

Source:

(static) init()

Initialize the component

Source:

(private, static) playVideosInView()

Plays a video with data-video-defer="view" attribute if it's within the viewport threshold

Source:

(static) reflow()

Reflow the component

Source: