8dd047be by Gary Katsevman Committed by David LaPalomento

Move decrypt function

Put decrypt() onto videojs.Hls to be more consistent with other "static" functions.
1 parent 3b8970dc
...@@ -247,7 +247,6 @@ decrypt = function(encrypted, key, initVector) { ...@@ -247,7 +247,6 @@ decrypt = function(encrypted, key, initVector) {
247 }; 247 };
248 248
249 // exports 249 // exports
250 videojs.hls = videojs.util.mergeOptions(videojs.hls, { 250 videojs.Hls.decrypt = decrypt;
251 decrypt: decrypt 251
252 });
253 })(window, window.videojs, window.pkcs7.unpad); 252 })(window, window.videojs, window.pkcs7.unpad);
......
...@@ -46,7 +46,7 @@ test('decrypts a single AES-128 with PKCS7 block', function() { ...@@ -46,7 +46,7 @@ test('decrypts a single AES-128 with PKCS7 block', function() {
46 0x82, 0xa8, 0xf0, 0x67]); 46 0x82, 0xa8, 0xf0, 0x67]);
47 47
48 deepEqual('howdy folks', 48 deepEqual('howdy folks',
49 stringFromBytes(videojs.hls.decrypt(encrypted, key, initVector)), 49 stringFromBytes(videojs.Hls.decrypt(encrypted, key, initVector)),
50 'decrypted with a byte array key'); 50 'decrypted with a byte array key');
51 }); 51 });
52 52
...@@ -68,7 +68,7 @@ test('decrypts multiple AES-128 blocks with CBC', function() { ...@@ -68,7 +68,7 @@ test('decrypts multiple AES-128 blocks with CBC', function() {
68 ]); 68 ]);
69 69
70 deepEqual('0123456789abcdef01234', 70 deepEqual('0123456789abcdef01234',
71 stringFromBytes(videojs.hls.decrypt(encrypted, key, initVector)), 71 stringFromBytes(videojs.Hls.decrypt(encrypted, key, initVector)),
72 'decrypted multiple blocks'); 72 'decrypted multiple blocks');
73 }); 73 });
74 74
......