Tag Archives: drupal video module

Drupal module to embed vdocipher videos

Your videos on vdocipher are protected and can only be played when generating an access token for each video view. This access token needs to be generated securely in your website backend. The Drupal module does this thing in your Drupal website without getting your hands dirty in API programming.  With this module you can add videos inside any text field in content_type in your Drupal website.

The module uses a shortcode like syntax to parse and display videos inside any node such as an article or a page or a custom content type. The markup of the content body is processed and the shortcode syntax is replaced with the player code.

Download here

  1. Download the module file from the link above.
  2. Upload the module file from the install new module page in your Drupal “install new module” page.
  3. Enable the uploaded module.
  4. Click on the configure link in the module page to complete your setup.
  5. Copy your API secret key from vdocipher dashboard > config > general.
  6. Enter the API key in Drupal and save your settings.
  7. Save the configuration.
  8. Copy a video id from your vdocipher dashboard. Edit an existing node in Drupal and add this code in any text field (replace aaaaaaa with id of a video).
    1. [vdo id=aaaaaaa]
  9. Open the article on a page. You should see the video player in your Drupal website.

Q. I am seeing the message: Unauthorized
A. Most probably, you have extra spaces in the API key configuration. Go to the module configuration for vdocipher and make sure the API key is correct.

Q. I am seeing message: Video not found
A. This would probably mean that the video id is not correct. The rich-text editor you are using to add the shortcode might have added extra characters. Content saved in the database is HTML while you are shown rendered HTML in the editor. Click on one of the “view source” option in your editor and try re-pasting the shortcode. Also, make sure there are no spaces before or after the equality sign.

Q. How to set this up for selling video as PPV or subscription?
A. The video can only be viewed by the person who has purchased a membership or a video. You need to set up Drupal permissions such as only those persons can view the assigned content-type which has video.

Q. The height and width are not what I want
A. The height and width are taken from the module configuration and overridden from the shortcode. Did I tell you, you can also add the height and width info like the following. In case the provided width is greater than the available width, the width is set to 100% of available width and height is adjusted to keep the same aspect ratio as provided by the settings.

Q. Why is this not integrated with the media module
A. That what was the idea when we started working on it. But turns out there are certain permission concerns that we need to understand to make sure that using the media module is alright for your video accessibility.

Q. How to manage permission on creating video playable contents
A. The shortcode for video can be added to any node and thus anybody who has the permission to create node(any content type) can add a shortcode to play the video. Note that comment is not a node. We understand this might be a problem for your set-up in a multi-user environment. We plan to solve this problem in the next version with either a custom content type or using the media module to make it easy to control permissions. At the very least, we can add a white-list of content-types which can only have a video embedded in it but it might not work in all cases.

Note on watermark adding.

The watermark can be added to your videos to imprint info about the logged in user or an image for branding. You can configure the watermark from the module configuration page. Check this article for more information on the structure and format required to add watermark text or image in the video. We are going to add a new article on how to configure the watermark in Drupal.

A note about caching

OTP generated here is temporary. You can not cache this OTP and send it to multiple users as it might cause trouble. The OTP once used gets expired and can no longer be used to play video. Some extensions might try to automate the page rendering and especially when on pages which do not need login. The configuration must be set to make sure pages with embedded videos are not cached and cause error while playback.

vdocipher api illustration

For reference about how everything works, please check API reference.

Do let us know about your experiences setting up your secure video in Drupal to create your own PPV or subscription-based video portal. and how we can make the integration simpler.