skip-video

skip-video

Makes the video skip to its end or fast forwards it by setting the currentTime attribute of the video object.

Parameters

Mandatory

Name

Description

Mandatory

playerSelector

CSS or XPath selector to the video element.

Yes

xpathCondition

XPath selector to know when to trigger the skipping logic.

Yes

Optional parameters

Name

Description

Default

-skip-to

Time to skip to. Zero/negative skips to end (duration + skipTo). Positive fast-forwards by that value.

-0.1

-max-attempts

Maximum retry attempts when video is not fully loaded.

10

-retry-ms

Interval in ms between retry attempts.

10

-wait-until

Delay snippet until given state is reached (loading, interactive, complete, load, or event name).

Disabled

-run-once

Disable the snippet after skipping once.

false

-stop-on-video-end

Pause snippet when video is near its end (< 0.5s remaining).

false

-start-from

Start the skipping from this time position.

0

-mute-video-when-skipping

Mutes the video during skipping.

true

Filter examples

Filter

Result

skip-video 'video.main-video-player' './/div[contains(@class,"player-container")][contains(@class, "ad")]'

Skips video to end when the div has class ad.

skip-video 'selector-to-video' 'xpath-condition' '-run-once:true' '-skip-to:10'

Skips 10 seconds, only once.

skip-video 'selector-to-video' 'xpath-condition' '-wait-until:load' '-stop-on-video-end:true'

Waits for page load and stops when video is near its end.