Build the best video experiences

Works with your setup

Manage videos using API, enable automatic video upload and get OTP for playback

Customise player design or add interactive features using Player API. Use the lightweight video player with support of chapters, closed captions, DRM, Auto-resume-from-last position and more features.

Integrate VdoCipher SDK to your android and iOS apps with the help of our SDKs. Offline downloads, custom player, Full API controllable, and more features.

OTP-based Playback

Why You Need OTP for Secure Streaming

Non-secure video platforms enable video embed through iFrames. These iFrames however can be used by anybody to download or share the video.

VdoCipher uses a unique embed code per session to play videos. This embed code uses a short-lived access token, called an OTP. Our use of an OTP ensures that videos are authenticated in every session, so that only logged in paying users get to watch your premium content.

How to generate OTP

  • You can find the API secret key for your account by logging into the Dashboard -> Config tab.
  • To generate OTP and playbackInfo, your site backend has to make HTTP POST request to API server using the API secret key. The API URL has to include the video ID.
  • The API call returns OTP and Playback Info, which your site backend has to then add to the video embed code.
  • You can find more details and sample codes for generating OTP from the Server API Docs.

Sample Code for HTTP POST request to API server with Secret key

$ curl -X POST https://dev.vdocipher.com/api/videos/{VIDEOID}/otp -H
      'authorization: Apisecret _________'
      

The API call would return a JSON object with OTP and playback info:

{
    "otp": "1234567890z26y25x24",
    "playbackInfo": "a1b2c3d4e5f6h7"
}
      

Video Player Embed Code

Your website backend needs to send the OTP and playbackInfo to the site frontend, to authorize video playback. More details on the player embed code can be found in the VdoPlayer Reference.


    <iframe
      src="https://player.vdocipher.com/v2/?otp=[[REPLACE_WITH_OTP]]&playbackInfo=[[REPLACE_WITH_PLAYBACKINFO]]"
      style="border:0;width:720px;height:405px"
      allow="encrypted-media"
      allowfullscreen
    ></iframe>
          

You may wish to change the id of the global div, from embedBox to something more unique. For instance you may append a random number to embedBox, so that each video player displayed on your page has a unique id.

Integrating VdoCipher Embed Code

There are broadly two kinds of web applications - MVC apps and SPAs. VdoCipher integration for the respective use cases differ slightly.

MVC Applications

In Web Apps using Model-View-Controller Architecture the backend directly renders the web page. Prominent platforms using MVC architecture are PHP frameworks (Laravel, Yii), Python (Django), Ruby on Rails, and Jade Template Engine using Express

In MVC apps the OTP can be generated when the page itself is loading. You can pass the OTP and PlaybackInfo as parameters from Controller to View. With these parameters added to the embed code your video would be ready to play.

Single-Page Applications

Single Page Apps (SPA) load scripts and other assets only once per session. Data for each new page is served using JSON or XML. React and Angular are the most prominent platforms for building SPAs

In an SPA it is recommended to create an API endpoint which can authenticate the logged-in user and check their access to the requested videos. This endpoint will return the OTP and PlaybackInfo. The front end would handle the response and load the video.

Ready-to-Use Plugins

For popular Content Management Systems you will only need to install VdoCipher plugin. Our plugin handles the OTP and PlaybackInfo generation by itself, so that embedding videos to your website is easy and straightforward.

VdoCipher Support is always there for you

As you can see, adding security features to videos creates additional steps to your workflow beyond simply adding a single embed code.

We fully understand that there might be things that you would need our help for. Our support executives are available at all times to help you secure your encrypted videos to your site.

We are fully committed to providing you Hollywood-level DRM for your invaluable intellectual property, and to support you in creating your video-based business.

Check out our Secure Streaming features

Sign up for a free 30-day trial to get started