Watermark user/time specific dynamic variables on WordPress videos

To check and download the WordPress plugin, please go http://wordpress.org/plugins/vdocipher/

 

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

{ip} : $_SERVER[‘REMOTE_ADDR’]

{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="aaaaaaa" no_annotate="true"]