pssh-tools
Advanced tools
Comparing version 0.0.9 to 0.0.10
const widevine = require('./widevine') | ||
const playready = require('./playready') | ||
const tools = require('./tools') | ||
const { system } = require('./utils') | ||
const tools = (systemName) => { | ||
switch (systemName) { | ||
case system.WIDEVINE.name: | ||
return widevine | ||
case system.PLAYREADY.name: | ||
return playready | ||
default: | ||
throw new Error('Unknown drm system') | ||
} | ||
} | ||
module.exports = { | ||
system, | ||
widevine, | ||
playready, | ||
tools | ||
} |
const crypto = require('crypto') | ||
const utils = require('./utils') | ||
const utils = require('./tools') | ||
@@ -161,9 +161,4 @@ const DRM_AES_KEYSIZE_128 = 16 | ||
const decodePssh = (data) => { | ||
return utils.decodePSSH(data) | ||
} | ||
module.exports = { | ||
encodePssh, | ||
decodePssh | ||
encodePssh | ||
} |
const path = require('path') | ||
const protobuf = require('protobufjs') | ||
const utils = require('./utils') | ||
const utils = require('./tools') | ||
@@ -77,9 +77,4 @@ const getPsshData = ({ contentId = null, trackType = '', keyIds = [], provider = '', protectionScheme = 'cenc' }) => { | ||
const decodePssh = (data) => { | ||
return utils.decodePSSH(data) | ||
} | ||
module.exports = { | ||
encodePssh, | ||
decodePssh | ||
encodePssh | ||
} |
{ | ||
"name": "pssh-tools", | ||
"version": "0.0.9", | ||
"version": "0.0.10", | ||
"description": "Tools to generate PSSH Data and PSSH Box", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -9,7 +9,6 @@ const test = require('ava') | ||
test('Should return Widevine PSSH version 0 without KID', t => { | ||
const wvTools = pssh.tools(pssh.system.WIDEVINE.name) | ||
const payload = { contentId: 'cenc-content-id', trackType: 'HD', provider: 'widevine_test', protectionScheme: 'cenc', dataOnly: false } | ||
const data = wvTools.encodePssh(payload) | ||
const result = wvTools.decodePssh(data) | ||
const data = pssh.widevine.encodePssh(payload) | ||
const result = pssh.tools.decodePssh(data) | ||
@@ -21,7 +20,6 @@ t.is(result.version, 0) | ||
test('Should return Widevine PSSH version 0 with KIDs', t => { | ||
const wvTools = pssh.tools(pssh.system.WIDEVINE.name) | ||
const payload = { contentId: 'cenc-content-id', trackType: 'HD', keyIds: [KID], provider: 'widevine_test', protectionScheme: 'cenc', dataOnly: false } | ||
const data = wvTools.encodePssh(payload) | ||
const result = wvTools.decodePssh(data) | ||
const data = pssh.widevine.encodePssh(payload) | ||
const result = pssh.tools.decodePssh(data) | ||
@@ -35,7 +33,6 @@ console.log(result.printPssh()) | ||
test('Should return PlayReady PSSH version 1 with KID', t => { | ||
const prTools = pssh.tools(pssh.system.PLAYREADY.name) | ||
const payload = { keyIds: [KID], licenseUrl: LA_URL, dataOnly: false } | ||
const data = prTools.encodePssh(payload) | ||
const result = prTools.decodePssh(data) | ||
const data = pssh.playready.encodePssh(payload) | ||
const result = pssh.tools.decodePssh(data) | ||
@@ -49,7 +46,6 @@ console.log(result.printPssh()) | ||
test('Should return PlayReady PSSH version 1 with Header Version 4.0.0.0 and KID', t => { | ||
const prTools = pssh.tools(pssh.system.PLAYREADY.name) | ||
const payload = { keyIds: [KID], licenseUrl: LA_URL, compatibilityMode: true, dataOnly: false } | ||
const data = prTools.encodePssh(payload) | ||
const result = prTools.decodePssh(data) | ||
const data = pssh.playready.encodePssh(payload) | ||
const result = pssh.tools.decodePssh(data) | ||
@@ -63,5 +59,3 @@ console.log(result.printPssh()) | ||
test('Should be able to decode PSSH generated from PSSH-BOX', t => { | ||
const wvTools = pssh.tools(pssh.system.WIDEVINE.name) | ||
const result = wvTools.decodePssh(PSSH_TEST) | ||
const result = pssh.tools.decodePssh(PSSH_TEST) | ||
console.log(result.printPssh()) | ||
@@ -68,0 +62,0 @@ |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
22125
502
1