How to add a video preview to your site?

Before adding a video preview to your site, make sure that it is added to the My Sites list

If the user has a Premium PRO on k2s, he will be able to watch the full video on your site.

Method 1 (recommended):
You can use the script to have under (or above) all links k2s on the page automatically added video previews if possible (the file is not deleted, the preview is available, etc.)

To do this, you need to insert in the page code before the </ head> tag:
<script src = “” data-cfasync=”false”> </ script>

You can also set the width, height of the video, indents and position of the video relative to the link.

Method 1. The settings of the player when automatically added to the site.

The default size of the player will be is 400: 225px.

You can also set the width, height of the video, indents and position of the video relative to the link.

Example: <script data-padding = “2px 5px” data-align=”left” data-width = “500px” data-height = “56.25%” src = “” data-content-order=”preview,link” data-cfasync=”false”> < / script>


data-padding = “2px 5px” – padding at the top and bottom of 2px, right and left 5px

data-align=”left” – position of the video on the left of the page (if you do not add this parameter to the script, the video is aligned depending on the parent <div>)

data-width – the maximum width of the video

data-height – the ratio of the video height to the width (56.25% value for the ratio 16: 9)

data-content-order – the parameter that specifies the position of the video relative to the link. If you do not use this parameter, the preview will be added under the link. If you set it to “preview, link”, then the video will be above the link.

Method 2

Previews to the site can also be manually added individually:

To do this, add the player code in the page code to the place where you want to place the video preview:

To add a video preview to your site (post or topic), you need to insert player code to the place were you wish the video preview should be added.

<script data-url=”{url}” data-width=”500px” data-height=”56.25%” src=””></script>

Where {url} is a file url, e.g.

data-width – maximum video width

data-height – the ratio of the height of the video to the width (56.25% value for the ratio 16: 9)

Thus, the size of the displayed video preview will be adaptive and adjust to the width of the screen.

And if the preview is not available, it simply will not be displayed on the page.

To position the preview on the site page, use HTML and CSS

To automatically generate code for each file, you can add a template.

To do this, go to the ” LinkSettings” and add the necessary code to the new line of the “Template” field.

Then click “Save”.

Next, go to “My files”, find the desired file, open it. Below is the code to insert on your site

File url inside the code was automatically substituted.

It remains to copy the code and insert it to your page code.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.