pssh-tools
Advanced tools
Comparing version 0.0.11 to 0.0.12
@@ -288,2 +288,14 @@ const path = require('path') | ||
const decodePsshData = (targetSystem, data) => { | ||
const dataBuffer = Buffer.from(data, 'base64') | ||
switch (targetSystem.name) { | ||
case system.WIDEVINE.name: | ||
return decodeWVData(dataBuffer) | ||
case system.PLAYREADY.data: | ||
return decodePRData(dataBuffer) | ||
default: | ||
return null | ||
} | ||
} | ||
module.exports = { | ||
@@ -293,4 +305,3 @@ system, | ||
decodePssh, | ||
decodePRData, | ||
decodeWVData | ||
decodePsshData | ||
} |
{ | ||
"name": "pssh-tools", | ||
"version": "0.0.11", | ||
"version": "0.0.12", | ||
"description": "Tools to generate PSSH Data and PSSH Box", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -64,3 +64,3 @@ const test = require('ava') | ||
test('Should be able to decode PlayReady PSSH data', t => { | ||
const result = pssh.tools.decodePRData(Buffer.from(PSSH_DATA, 'base64')) | ||
const result = pssh.tools.decodePsshData(pssh.tools.system.PLAYREADY.name, PSSH_DATA) | ||
console.log(result.recordXml) | ||
@@ -67,0 +67,0 @@ |
23683
530