How to add dynamic watermark to the video player

Demo of Dynamic Watermark

You can view the demo of our watermark here:

1. How to add a dynamic watermark in Javascript embed code

Step 1.

Edit your project and go to the "Video Options" tab or click on a video title in the dashboard and find the "Options" tab. Please enable the option "Dynamic watermark".

Step 2.

To add a dynamic watermark to the video player, you just need to add an attribute `data-watermark` to the DIV of your embed code.

<div data-watermark="Dynamic Watermark" data-dyntube-key="abcd1234"></div>

This will show you an animated watermark on the video player

Turn off IP Watermark

Please remember to turn off the "IP Watermark" option in the dashboard in order for the dynamic watermark to work. Only one of these watermarks can work at a time.

2. Watermark on iframe-based embed code

Step 1.

Edit your project and go to the "Video Options" tab or click on a video title in the dashboard and find the "Options" tab. Please enable the option "Dynamic watermark".

Step 2

If you are using iframe-based embe code then you can add the watermark in the URL of iframe.

https://videos.dyntube.com/iframes/AHCWERUYER387?watermark=MY-WATERMARK

3. Adding Dynamic Watermark with Current WordPress Username

Enhance user experience on your WordPress website by adding a dynamic watermark that displays the current username of logged-in users. Follow these quick steps to implement this feature:

  1. Access User Data: Utilize the wp_get_current_user() function to retrieve the logged-in user's information, specifically the username.

    <?php
    $current_user = wp_get_current_user();
    $username = $current_user->user_login;
    ?>
  2. Display Watermark: Insert the obtained username into the data-watermark attribute of a designated HTML element. Ensure security by using the esc_attr() function to escape the username.

    <div data-watermark="<?php echo esc_attr($username); ?>" data-dyntube-key="abcd1234"></div>
  3. Implementation: Add the provided PHP code and HTML element to your WordPress templates or pages for the watermark to appear.

By following these steps, you'll create a personalized touch on your website, engaging users with a dynamic watermark displaying their usernames.

Last updated