Skip to content

Latest commit

 

History

History
41 lines (37 loc) · 3.92 KB

README.md

File metadata and controls

41 lines (37 loc) · 3.92 KB

Extend VdoCipher plugin

Using this plugin you can extend the VdoCipher WordPress plugin. This plugin requires the VdoCipher WordPress plugin version 1.26 or more to be installed.

We have implemented the child theme - theme framework architecture, so that you can freely extend the VdoCipher plugin without having to worry about breaking changes when the main VdoCipher plugin updates.

In this plugin, we provide functions for two use cases:

  • Adding Chapters links over the player, so that user can skip ahead to the relevant time in the video
  • Add custom watermark attributes

These remain the most common requirements from our users. If you have any additional requirements you should be able to go through the functions given here and tweak them according to your requirement, or else contact our support team at VdoCipher.

Hooks

vdocipher_customize_player

All functions attached to this hook run at the very end of the vdocipher shortcode parsing.

Filters

vdocipher_add_shortcode_attributes

Using this filter you can add your own attributes to the shortcode

vdocipher_annotate_preprocess

Use this filter to display custom user information - before any processing by the vdocipher plugin itself

vdocipher_annotate_postprocess

Use this filter to display custom user information - after the vdocipher plugin has processed {name}, {email}, {username}, {id}, {ip}, and {date}

vdocipher_modify_otp_request

Use this to send additional OTP body specifications, as can be found in the Server API docs

Use Cases

The following class should always be included:classes/vdocipher-customize-essentials.php. It enqueues the files js/vdocipherapiready.js and styles/overlay.css. You can add all custom css in the overlay.css file. Make sure that all css classes are preceded by .vc-container selector

Add Chapters

  1. Make sure that classes/vdocipher-add-chapters.php is included in the main plugin file
  2. The function new_vdo_shortcode_attribute adds a new attribute to the vdocipher shortcode - chapters. This function is hooked to the filter vdocipher_add_shortcode_attributes
  3. The value given to the attribute is then processed in insert_chapters and insert_chapters_with_names function. Please use only one of these functions. All the functions are called by attaching them to VdoCipher hooks and filters, in the class constructor of VdoCipherAddChapters class. Uncomment the function that you would like to use.
  4. insert_chapters takes comma separated time values, and outputs list of chapters over the video, with chapters labelled as Chapter 1, Chapter 2 and so on. The usage is
    [vdo id="1234567890" chapters="500,700,1000"]
    Each of the comma separated values is the duration in the video in seconds that clicking the button will seek to
  5. In the insert_chapters_with_names function, the chapters attribute takes in chapter names and the time to seek as input. The format is
    [vdo id="1234567890" chapters="Chapter 1, 500; Chapter 2, 700; Chapter 3, 1000"]
    Chapter name and Chapter time in seconds are separated by comma, different chapter values are separated by semi-colons.

Please use only one of these two functions. These functions insert_chapters and insert_chapters_with_names are presented here for completeness. If there is any code here that you do not require, you are free to remove it.