1.2.5 • Published 9 years ago
vdocipher v1.2.5
VdoCipher
VdoCipher API Nodejs module for vdocipher API to obtain token for authenticated playback
Kind: global class
- VdoCipher
- new VdoCipher(key)
- instance
- inner
- ~getOtpCallback : function
new VdoCipher(key)
configures the API instance
| Param | Type | Description |
|---|---|---|
| key | string | Your API Secret key from dashboard |
vdoCipher.getOtp(videoId, options, callback)
obtain the OTP
Kind: instance method of VdoCipher
| Param | Type | Description |
|---|---|---|
| videoId | string | alphanumeric id of your vdocipher video |
| options | Object | extra options such as forcedBitrate and watermark |
| callback | getOtpCallback | which will be called with otp |
vdoCipher.getSignaure(playbackInfo) ⇒ string
get signature for auth video playback
Kind: instance method of VdoCipher
Returns: string - signature created using the secret key
| Param | Type | Description |
|---|---|---|
| playbackInfo | Object | base64 encoding of a json string with info about the time expiry and media info and other DRM data |
| playbackInfo.video | string | 32-char video id |
| playbackInfo.expiry | integer | the unix timestamp time in seconds |
| playbackInfo.ipgeorules | string | ip/geo ruleset as a json string as defined in https://www.vdocipher.com/blog/2017/01/set-ip-geo-restriction-videos-via-api-vdocipher-drm/ |
| playbackInfo.user | string | user information as a structured json |
| playbackInfo.extra | string | extra information as a json string |
| playbackInfo.watermark | string | watermark preset indentifier |
VdoCipher~getOtpCallback : function
This callback is used to retrieve the otp
Kind: inner typedef of VdoCipher
| Param | Type | Description |
|---|---|---|
| error | Error | Should be null for success, check error.message for detail |
| response | Object | The otp json container |
| response.otp | string | the 64 character otp |