Links

skip-video

Makes the video skip to its end or to a given timestamp. It does it by setting the currentTime attribute of the video object.

Parameters

Name
Description
Mandatory
Default Value
playerSelector
The CSS or the XPath selector to the element in the page.
Yes
-
xpathCondition
The XPath selector that will be used to know when to trigger the skipping logic.
Yes
-
skipTo
Determines the time of the video to skip to. If the value is zero or negative, the snippet skips to the end of the video (video.currentTime = video.duration + skipTo). If the skipTo value is positive, the snippets skips the video by the given value (video.currentTime = video.currentTime + skipTo). A small negative value like (-0.1) or zero is preferred for most of the cases as it would cause the video to nearly instantly end. Large positive values can be used to quickly fast forward a video (5-10 seconds at a time) to better mimic user behaviour and escape some detection methods. Example: If there is a 30 second ad, -0.1 is given as the skipTo parameter, the video will be instantly skipped to 29.900 (0.1 seconds before the 30 second mark). If positive 10 seconds is given as the skipTo parameter, video will be skipped to 10 seconds, 20 seconds and to 30 seconds every time there is a tick of the snippet (happens at every page mutation). If 0 is given as the skipTo parameter, video will be instantly skipped to the end (30 second mark). Unit is in seconds.
No
-0.1
maxAttempts
If the video is not fully loaded by the time the xPath condition is met; there is a retry mechanism in the snippet. The snippet will try to skip the video once every retryMs interval. maxAttempts parameter will determine the maximum number of attempts the snippet should do before giving up. This parameter doesn't need to be changed for most of the cases but might be useful for some circumvention scenarios.
No
10
retryMs
If the video is not fully loaded by the time the xPath condition is met; there is a retry mechanism in the snippet. The snippet will try to skip the video once every retryMs interval. This parameter doesn't need to be changed for most of the cases. Unit is in milliseconds.
No
10

Filter examples

The following table lists examples that use the skip-video snippet:
Filter
Result
skip-video 'video.main-video-player' './/div[contains(@class,“player-container”)][contains(@class, “ad”]'
Finds the video player with main-video-player class and skips it to the end whenever the div with player-container class has the class ad attached it.
Last modified 3mo ago