jmuxer 2.1.0 → 2.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/karma.conf.js DELETED
@@ -1,77 +0,0 @@
1
- // Karma configuration
2
- // Generated on Fri Nov 03 2017 16:10:03 GMT+0600 (+06)
3
-
4
- module.exports = function(config) {
5
- config.set({
6
-
7
- // base path that will be used to resolve all patterns (eg. files, exclude)
8
- basePath: '',
9
-
10
-
11
- // frameworks to use
12
- // available frameworks: https://npmjs.org/browse/keyword/karma-adapter
13
- frameworks: ['mocha', 'chai'],
14
-
15
- // list of files / patterns to load in the browser
16
- files: [
17
- 'test/*.js'
18
- ],
19
-
20
- // list of files to exclude
21
- exclude: [
22
- ],
23
-
24
- // preprocess matching files before serving them to the browser
25
- // available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor
26
- preprocessors: {
27
- 'test/*.js': ['rollup']
28
- },
29
-
30
- rollupPreprocessor: {
31
- plugins: [
32
- require('@rollup/plugin-babel')
33
- ],
34
- output: {
35
- format: 'iife', // Helps prevent naming collisions.
36
- name: 'JMuxer', // Required for 'iife' format.
37
- sourcemap: 'inline', // Sensible for testing.
38
- }
39
- },
40
-
41
- // test results reporter to use
42
- // possible values: 'dots', 'progress'
43
- // available reporters: https://npmjs.org/browse/keyword/karma-reporter
44
- reporters: ['progress'],
45
-
46
-
47
- // web server port
48
- port: 9876,
49
-
50
-
51
- // enable / disable colors in the output (reporters and logs)
52
- colors: true,
53
-
54
-
55
- // level of logging
56
- // possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG
57
- logLevel: config.LOG_INFO,
58
-
59
-
60
- // enable / disable watching file and executing tests whenever any file changes
61
- autoWatch: false,
62
-
63
-
64
- // start these browsers
65
- // available browser launchers: https://npmjs.org/browse/keyword/karma-launcher
66
- browsers: ['Chrome'],
67
-
68
-
69
- // Continuous Integration mode
70
- // if true, Karma captures browsers, runs the tests and exits
71
- singleRun: true,
72
-
73
- // Concurrency level
74
- // how many browser should be started simultaneous
75
- concurrency: Infinity
76
- })
77
- }
package/test/event.js DELETED
@@ -1,30 +0,0 @@
1
- //import { assert } from 'chai';
2
- import Event from '../src/util/event.js';
3
-
4
- var event = new Event('XYZ');
5
-
6
- var callback = function() {
7
- };
8
-
9
- describe('event tests --', function() {
10
-
11
- beforeEach(function(){
12
- event.offAll();
13
- event.on('topic1',callback);
14
- event.on('topic1',callback);
15
- event.on('topic2',callback);
16
- });
17
-
18
- it('listener count should be 2 for the topic1', function() {
19
- assert.equal(event.listener.topic1.length, 2);
20
- });
21
-
22
- it('event dispatcher should be return true for a successful dispatcher', function() {
23
- assert.equal(event.dispatch('topic1', true), true);
24
- });
25
-
26
- it('listener count should be zero after removing all listeners', function() {
27
- event.offAll();
28
- assert.deepEqual(event.listener, {});
29
- });
30
- });
package/test/parser.js DELETED
@@ -1,35 +0,0 @@
1
- //import { assert } from 'chai';
2
-
3
- import { BaseRemuxer } from '../src/remuxer/base.js';
4
- import { H264Parser } from '../src/parsers/h264.js';
5
- import { AACParser } from '../src/parsers/aac.js';
6
-
7
- var h264 = new Uint8Array([0, 0, 0, 1, 103, 66, 192, 30, 218, 2, 128, 191, 229, 192, 90, 128, 128, 131, 32, 0, 0, 3, 0, 32, 0, 0, 7, 129, 226, 197, 212, 0, 0, 0, 1, 113, 76, 122, 37, 218, 2, 128, 191, 229, 192, 90, 128, 128, 131, 32, 0, 0, 3, 0, 32, 0, 0, 70, 129, 126, 195, 202]);
8
- var aac = new Uint8Array([255, 241, 80, 128, 35, 159, 252, 33, 10, 84, 140, 49, 34, 72, 2, 57, 103, 72, 21, 128, 32, 144, 42, 44, 7, 107, 116, 93, 199, 51, 237, 104, 181, 31, 37, 29, 169, 190, 111, 167, 139, 124, 85, 72, 37, 148, 183, 228, 87, 188, 200, 76, 226, 83, 160, 18, 11, 69, 80, 4, 118, 229, 129, 250, 22, 242, 222, 49, 146, 29, 19, 237, 71, 235, 29, 127, 235, 134, 186, 14, 8, 67, 103, 141, 13, 32, 238, 184, 3, 232, 183, 8, 109, 150, 199, 97, 203, 164, 240, 233, 12, 216, 246, 220, 78, 25, 250, 33, 10, 84, 140, 49, 34, 72, 2, 57, 103, 72, 21, 128, 32, 144, 42, 44, 7, 107, 116, 93, 199, 51, 237, 104, 181, 31, 37, 29, 169, 190, 111, 167, 139, 124, 85, 72, 37, 148, 183, 228, 87, 188, 200, 76, 226, 83, 160, 18, 11, 69, 80, 4, 118, 229, 129, 250, 22, 242, 222, 49, 146, 29, 19, 237, 71, 235, 29, 127, 235, 134, 186, 14, 8, 67, 103, 141, 13, 32, 238, 184, 3, 232, 183, 8, 109, 150, 199, 97, 203, 164, 240, 233, 12, 216, 246, 220, 78, 25, 250, 33, 10, 84, 140, 49, 34, 72, 2, 57, 103, 72, 21, 128, 32, 144, 42, 44, 7, 107, 116, 93, 199, 51, 237, 104, 181, 31, 37, 29, 169, 190, 111, 167, 139, 124, 85, 72, 37, 148, 183, 228, 87, 188, 200, 76, 226, 83, 160, 18, 11, 69, 80, 4, 118, 229, 129, 250, 22, 242, 222, 49, 146, 29, 19, 237, 71, 235, 29, 127, 235, 134,33,44,66,34,23]);
9
-
10
-
11
- describe('Parser tests --', function() {
12
-
13
- it('Number of extracted h264 NAL unit should be 2', function() {
14
- var result = H264Parser.extractNALu(h264);
15
- assert.equal(result.length, 2);
16
- });
17
-
18
- it('AAC pattern should return true', function() {
19
- assert.equal(AACParser.isAACPattern(aac), true);
20
- });
21
-
22
- it('AAC header length should be 7 since CRC not present', function() {
23
- assert.equal(AACParser.getHeaderLength(aac), 7);
24
- });
25
-
26
- it('AAC frame length should be 284', function() {
27
- assert.equal(AACParser.getFrameLength(aac), 284);
28
- });
29
-
30
- it('Number of extracted AAC frames should be 1', function() {
31
- var result = AACParser.extractAAC(aac);
32
- assert.equal(result.length, 1);
33
- });
34
- });
35
-
package/test/utils.js DELETED
@@ -1,19 +0,0 @@
1
- //import { assert } from 'chai';
2
- import { appendByteArray } from '../src/util/utils.js';
3
-
4
- var arr1 = new Uint8Array([1,2,3,4,5]);
5
- var arr2 = new Uint8Array([6,7,8]);
6
-
7
- describe('Utils tests --', function() {
8
-
9
- it('Appended array length must be 8', function() {
10
- var result = appendByteArray(arr1, arr2);
11
- assert.equal(result.byteLength, 8);
12
- });
13
-
14
- it('8th element value must be 8', function() {
15
- var result = appendByteArray(arr1, arr2);
16
- assert.equal(result[7], 8);
17
- });
18
- });
19
-