Watermark user/time specific dynamic variables on WordPress videos

Please visit Add Text to Videos with Watermark for a detailed introduction to adding watermark to your videos. This particular blog explains what is going on under the hood of the WP plugin, and is useful only if you are adding your own custom-built variables as part of watermark. Currently name, IP and email can be shown as part of watermark.

You can download the WordPress plugin from the WP Plugin Directory

While adding videos watermark or annotation code on vdocipher videos using the WordPress plugin, you can configure the text to fetch dynamic user variables. These variables can be user name, email or date in custom format. Here is the complete list of variables which can be used in the annotation code.

{name} : This shows the display name of the user who is viewing the video. This calls the function: wp_get_current_user()->display_name

{email} : wp_get_current_user()->user_email

{username} : wp_get_current_user()->user_login

{id} : wp_get_current_user()->ID


{date} : This function allows you to configure the video to show date in custom format. You can use the predefined PHP date constants to display date. The format is {date.pattern}, where pattern will be the input of PHP’s date function.

preg_replace_callback('/\{date\.([^\}]+)\}/', function($matches)
   return date($matches[1]);
} , $vdo_annotate_code);


An example code using the above variable tokens:

{'type':'rtext', 'text':'Your IP : {ip}', 'alpha':'0.8', 'color':'0xFF0000','size':'12','interval':'5000'},
{'type':'text', 'text':'Time: {date.h:i:s A}', 'alpha':'0.5' , 'x':'150', 'y':'100', 'color':'0xFF0000', 'size':'12'}

Check example video for the above code here: https://www.vdocipher.com/blog/2014/12/add-text-to-videos-with-watermark/

Currently, the WordPress plugin supports a single annotation parameter across the website. If you must have a video without the annotation, you need to add a no_annotate parameter [vdo id='12345678' no_annotate=true]

You may also like...