VdoCipher Android SDK

Secure Video Streaming using Android App

Latest version: 1.10.0

This SDK enables you to securely stream DRM-protected videos through your Android app.

Getting Started

Add VdoCipher maven repo to app module's build.gradle

  repositories {
    // other repo, e.g. jcenter()
      url "https://github.com/VdoCipher/maven-repo/raw/master/repo"

Add dependency

  compile 'com.vdocipher.aegis:vdocipher-android:1.10.0'

Note: If your project has a local dependency on a previous version of the SDK (AAR module dependency), you'll need to remove them from the project.

  // remove this dependency if it exists from use of a previous version of SDK
    compile project(':vdocipher')

Integrating video playback

To integrate a player, just drop a VdoPlayerFragment into your activity layout with an id.


and receive its instance in your activity using findFragmentbyId()

  playerFragment = (VdoPlayerFragment)getFragmentManager().findFragmentById(R.id.online_vdo_player_fragment);

Get a VdoPlayer instance by calling PlayerHost.initialize() method on the playerFragment and receive the player in the onInitializationSuccess callback.

You can add callbacks for listening to playback events using VdoPlayer.addPlaybackEventListener() on the VdoPlayer object that is received in the onInitializationSuccess callback.

    public void onInitializationSuccess(VdoPlayer.PlayerHost playerHost, VdoPlayer player, boolean wasRestored) {
        Log.i(TAG, "onInitializationSuccess");
        this.player = player;
        // add a listener for playback events
        // ...

Once you have a player, you can start loading media onto it for playback. You'll need a VdoInitParams object to specify which media to load along with your preferences.

A VdoInitParams object needs playbackInfo and either otp or signature generated from your server.

  // load a media to the player
    VdoPlayer.VdoInitParams vdoParams = VdoPlayer.VdoInitParams.createParamsWithOtp(otp, playbackInfo);

This should be followed by onLoading and onLoaded callbacks signalling that media playback can start now.

    public void onLoading(VdoPlayer.VdoInitParams vdoInitParams) {
        Log.i(TAG, "onLoading");

    public void onLoaded(VdoPlayer.VdoInitParams vdoInitParams) {
        Log.i(TAG, "onLoaded");
        // playback can be controlled now

Handling orientation change

To make orientation change seamless, please override config changes for your activity by adding the following to your AndroidManifest.xml. This means that your activity won't go through the regular life-cycle events on device orientation change. If you require to change the layout, please use onConfigurationChanged callback in your activity to change the size or hide/unhide view elements.

Replace the name of activity with correct name.

  <activity android:name=".OnlinePlayerActivity"

Using ProGuard

If you use ProGuard in your app, you might need to add the following rule to your ProGuard file.

  -keep class com.vdocipher.aegis.* { ;  }

Offline Download using SDK

The VdoCipher Android SDK offers capability to download videos to the device's local storage. Videos would then be available for offline playback. This feature is available for Android devices running Lollipop and above (API level 20+).

Steps for Offline Android download for videos »

SafetyNet implementation in your Android App for enhanced Emulator protection

Safetynet Implementation via Google APIs allow higher app based security and ensures playback only in genuine physical devices

Steps for SafetyNet higher security integration on App side >>

Block devices who have developer mode ADB debugging on for higher security

Some users switch on ADB debugging in phone, for higher security it should be blocked. We have kept this optional as there will be few users who will not be able to play without switching ADB debugging off.

To block playback on devices with ADB debugging turned ON, use the setAllowAdbDebugging method of VdoInitParams.Builder when making the vdoParams:

VdoInitParams vdoParams = new VdoInitParams.Builder()





To ensure that such blocked users get right message so that they can switch off ADB debugging and play the video, please follow the below player code as part of SDK

Error message update for Blocked users so that they can change the setting >>



  • Option to block devices with ABD debugging on
  • Bug fixes.


  • Upgrade exoplayer dependency to 2.11.8
  • Add api to get device's analytics ID on vdocipher logs for error handling
  • Bug fixes.


  • Add option in VdoInitParams to turn off playback analytics collection.
  • Disable auto backup of downloaded offline video index.
  • Add error code for the case when a requested offline video is not found on the device.
  • Bug fixes.


  • SafetyNet Implementation for security enhancements


  • Offline Download Video Watermark addition


  • Bug fixes
  • Added Cast plugin dependencies


  • Further classify generic errors so they are easier to debug.
  • Bug fixes


  • Implemented Watermark Skip Behaviour
  • Bug fixes


  • Some generic error codes have been replaced with more informative specific ones
  • Bug fixes


  • New sdk available for Google Cast support; integration instructions and demo provided in sample app on github
  • Added support to specify resume time and autoplay behavior in VdoInitParams
  • Added support-library based player fragment
  • Improved offline playback compatibility
  • Bug fixes


  • Added API to specify start and end time for playback in VdoInitParams
  • Additional error information, when applicable, is available in DownloadStatus#reasonDescription, which can be parsed as a json to obtain details.
  • Bug fixes


  • Support for closed captions.
  • Support for setting aspect ratio and video stretch mode in VdoPlayerFragment.
  • Fixed offline media assets not being deleted on some devices when remove api is used.
  • Fixed occasional crash on background thread when starting a new download.
  • Bug fixes.


  • Added support for downloading media to local storage and playback of offline media
  • Simplified VdoInitParams interface
  • Bug fixes


  • Introduced multiple error codes and extended some in `ErrorCodes` class
  • Added Builder class to `VdoInitParams` as optionsal way to create init params
  • Fixed application crash when initiating secure playback
  • Other minor bug fixes


  • Fixed onMediaEnded callbacks not received in some cases.
  • Fixed loading new VdoInitParams on VdoPlayer which already has a media running: discard current media immediately and load new params.
  • Improved support for testing playback on emulators.
  • Bug fixes.


  • Changed player initialization workflow. Now you can initialize a PlayerHost to obtain a VdoPlayer instance without specifying any VdoInitParams. Once obtained, a VdoPlayer instance can be used to load media for playback.
  • Changed VdoPlayer api. Many api and callback methods have been added/removed/renamed in accordance with increased player capabilities. The javadoc lists the new api.
  • A playbackInfo string along with otp or signature is required for loading media to the player.
  • Added playback speed control related api.
  • Security enhancements and bug fixes.