Socket
Socket
Sign inDemoInstall

chimee-kernel-hls

Package Overview
Dependencies
Maintainers
6
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

chimee-kernel-hls - npm Package Compare versions

Comparing version 1.1.0 to 1.2.0

10

karma.conf.js

@@ -32,3 +32,3 @@ // process.env.CHROME_BIN = require('puppeteer').executablePath();

// available reporters: https://npmjs.org/browse/keyword/karma-reporter
reporters: [ 'mocha', 'coverage-istanbul', 'progress', 'coverage' ],
reporters: [ 'mocha', 'coverage-istanbul', 'progress', 'coverage', 'coveralls' ],

@@ -40,3 +40,3 @@ coverageIstanbulReporter: {

coverageReporter: {
type: 'html',
type: 'lcov',
dir: 'coverage/',

@@ -81,4 +81,6 @@ },

],
format: 'iife', // Helps prevent naming collisions.
name: camelize(name), // Required for 'iife' format.
output: {
format: 'iife', // Helps prevent naming collisions.
name: camelize(name), // Required for 'iife' format.
},
sourcemap: 'inline', // Sensible for testing.

@@ -85,0 +87,0 @@ },

308

lib/index.js
/**
* chimee-kernel-hls v1.1.0
* (c) 2017 songguangyu
* chimee-kernel-hls v1.2.0
* (c) 2017-2018 songguangyu
* Released under MIT

@@ -21,16 +21,3 @@ */

var chimeeHelper = require('chimee-helper');
var _Object$getOwnPropertyDescriptors = _interopDefault(require('babel-runtime/core-js/object/get-own-property-descriptors'));
var _Array$from = _interopDefault(require('babel-runtime/core-js/array/from'));
var _Object$getOwnPropertySymbols = _interopDefault(require('babel-runtime/core-js/object/get-own-property-symbols'));
var _Object$getOwnPropertyNames = _interopDefault(require('babel-runtime/core-js/object/get-own-property-names'));
var _Object$defineProperty = _interopDefault(require('babel-runtime/core-js/object/define-property'));
var _Object$keys = _interopDefault(require('babel-runtime/core-js/object/keys'));
var _Number$isInteger = _interopDefault(require('babel-runtime/core-js/number/is-integer'));
var _Number$parseFloat = _interopDefault(require('babel-runtime/core-js/number/parse-float'));
var _toConsumableArray = _interopDefault(require('babel-runtime/helpers/toConsumableArray'));
var _slicedToArray = _interopDefault(require('babel-runtime/helpers/slicedToArray'));
var _WeakMap = _interopDefault(require('babel-runtime/core-js/weak-map'));
var _Promise = _interopDefault(require('babel-runtime/core-js/promise'));
var _defineProperty = _interopDefault(require('babel-runtime/helpers/defineProperty'));
var _Object$preventExtensions = _interopDefault(require('babel-runtime/core-js/object/prevent-extensions'));
var toxicDecorators = require('toxic-decorators');

@@ -42,275 +29,2 @@ var defaultCustomConfig = {

/**
* toxic-predicate-functions v0.1.5
* (c) 2017 toxic-johann
* Released under MIT
*/
/**
* is void element or not ? Means it will return true when val is undefined or null
*/
function isVoid(obj) {
return obj === undefined || obj === null;
}
/**
* to check whether a variable is array
*/
function isArray(arr) {
return Array.isArray(arr);
}
/**
* is it a function or not
*/
function isFunction(obj) {
return typeof obj === 'function';
}
/**
* to tell you if it's a real number
*/
function isNumber(obj) {
return typeof obj === 'number';
}
/**
* is it a string
*/
function isString(str) {
return typeof str === 'string' || str instanceof String;
}
/**
* is Boolean or not
*/
function isBoolean(bool) {
return typeof bool === 'boolean';
}
/**
* is Primitive type or not, whick means it will return true when data is number/string/boolean/undefined/null
*/
function isPrimitive(val) {
return isVoid(val) || isBoolean(val) || isString(val) || isNumber(val);
}
/**
* toxic-utils v0.1.6
* (c) 2017 toxic-johann
* Released under MIT
*/
/**
* bind the function with some context. we have some fallback strategy here
* @param {function} fn the function which we need to bind the context on
* @param {any} context the context object
*/
function bind(fn, context) {
if (fn.bind) {
return fn.bind(context);
} else if (fn.apply) {
return function __autobind__() {
for (var _len2 = arguments.length, args = Array(_len2), _key3 = 0; _key3 < _len2; _key3++) {
args[_key3] = arguments[_key3];
}
return fn.apply(context, args);
};
} else {
return function __autobind__() {
for (var _len3 = arguments.length, args = Array(_len3), _key4 = 0; _key4 < _len3; _key4++) {
args[_key4] = arguments[_key4];
}
return fn.call.apply(fn, [context].concat(_toConsumableArray(args)));
};
}
}
/**
* toxic-decorators v0.3.8
* (c) 2017 toxic-johann
* Released under GPL-3.0
*/
var getOwnPropertyDescriptor = _Object$getOwnPropertyDescriptor;
/**
* to check if the descirptor is an data descriptor
* @param {descriptor} desc it should be a descriptor better
*/
function isDataDescriptor(desc) {
return !!desc && desc.hasOwnProperty('value') && isBoolean(desc.configurable) && isBoolean(desc.enumerable) && isBoolean(desc.writable);
}
/**
* set one value on the object
* @param {string} key
*/
function createDefaultSetter(key) {
return function set(newValue) {
_Object$defineProperty(this, key, {
configurable: true,
writable: true,
// IS enumerable when reassigned by the outside word
enumerable: true,
value: newValue
});
return newValue;
};
}
function getOwnKeysFn() {
var getOwnPropertyNames = _Object$getOwnPropertyNames,
getOwnPropertySymbols = _Object$getOwnPropertySymbols;
return isFunction(getOwnPropertySymbols) ? function (obj) {
// $FlowFixMe: do not support symwbol yet
return _Array$from(getOwnPropertyNames(obj).concat(getOwnPropertySymbols(obj)));
} : getOwnPropertyNames;
}
var getOwnKeys = getOwnKeysFn();
function getOwnPropertyDescriptorsFn() {
// $FlowFixMe: In some environment, Object.getOwnPropertyDescriptors has been implemented;
return isFunction(_Object$getOwnPropertyDescriptors) ? _Object$getOwnPropertyDescriptors : function (obj) {
return getOwnKeys(obj).reduce(function (descs, key) {
descs[key] = getOwnPropertyDescriptor(obj, key);
return descs;
}, {});
};
}
var getOwnPropertyDescriptors = getOwnPropertyDescriptorsFn();
var defineProperty$1 = _Object$defineProperty;
function classify(decorator) {
var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
requirement = _ref.requirement,
_ref$customArgs = _ref.customArgs,
customArgs = _ref$customArgs === undefined ? false : _ref$customArgs;
return function () {
for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
args[_key - 1] = arguments[_key];
}
var _ref2 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
_ref2$exclude = _ref2.exclude,
exclude = _ref2$exclude === undefined ? [] : _ref2$exclude,
_ref2$include = _ref2.include,
include = _ref2$include === undefined ? [] : _ref2$include,
_ref2$construct = _ref2.construct,
construct = _ref2$construct === undefined ? false : _ref2$construct,
_ref2$self = _ref2.self,
self = _ref2$self === undefined ? false : _ref2$self;
if (!isArray(exclude)) throw new TypeError('options.exclude must be an array');
if (!isArray(include)) throw new TypeError('options.include must be an array');
return function (Klass) {
var isClass = isFunction(Klass);
if (!self && !isClass) throw new TypeError('@' + decorator.name + 'Class can only be used on class');
if (self && isPrimitive(Klass)) throw new TypeError('@' + decorator.name + 'Class must be used on non-primitive type value in \'self\' mode');
var prototype = self ? Klass : Klass.prototype;
if (isVoid(prototype)) throw new Error('The prototype of the ' + Klass.name + ' is empty, please check it');
var descs = getOwnPropertyDescriptors(prototype);
getOwnKeys(prototype).concat(include).forEach(function (key) {
var desc = descs[key];
if (key === 'constructor' && !construct || self && isClass && ['name', 'length', 'prototype'].indexOf(key) > -1 || exclude.indexOf(key) > -1 || isFunction(requirement) && requirement(prototype, key, desc, { self: self }) === false) return;
defineProperty$1(prototype, key, (customArgs ? decorator.apply(undefined, _toConsumableArray(args)) : decorator)(prototype, key, desc));
});
};
};
}
var autobindClass = classify(autobind, {
requirement: function requirement(obj, prop, desc) {
// $FlowFixMe: it's data descriptor now
return isDataDescriptor(desc) && isFunction(desc.value);
}
});
var mapStore = void 0;
// save bound function for super
function getBoundSuper(obj, fn) {
if (typeof _WeakMap === 'undefined') {
throw new Error('Using @autobind on ' + fn.name + '() requires WeakMap support due to its use of super.' + fn.name + '()');
}
if (!mapStore) {
mapStore = new _WeakMap();
}
if (mapStore.has(obj) === false) {
mapStore.set(obj, new _WeakMap());
}
var superStore = mapStore.get(obj);
// $FlowFixMe: already insure superStore is not undefined
if (superStore.has(fn) === false) {
// $FlowFixMe: already insure superStore is not undefined
superStore.set(fn, bind(fn, obj));
}
// $FlowFixMe: already insure superStore is not undefined
return superStore.get(fn);
}
/**
* auto bind the function on the class, just support function
* @param {Object} obj Target Object
* @param {string} prop prop strong
* @param {Object} descriptor
*/
function autobind(obj, prop, descriptor) {
if (arguments.length === 1) return autobindClass()(obj);
var _ref = descriptor || {},
fn = _ref.value,
configurable = _ref.configurable;
if (!isFunction(fn)) {
throw new TypeError('@autobind can only be used on functions, not "' + fn + '" in ' + (typeof fn === 'undefined' ? 'undefined' : _typeof(fn)) + ' on property "' + prop + '"');
}
var constructor = obj.constructor;
return {
configurable: configurable,
enumerable: false,
get: function get() {
var _this = this;
var boundFn = function boundFn() {
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
return fn.call.apply(fn, [_this].concat(_toConsumableArray(args)));
};
// Someone accesses the property directly on the prototype on which it is
// actually defined on, i.e. Class.prototype.hasOwnProperty(key)
if (this === obj) {
return fn;
}
// Someone accesses the property directly on a prototype,
// but it was found up the chain, not defined directly on it
// i.e. Class.prototype.hasOwnProperty(key) == false && key in Class.prototype
if (this.constructor !== constructor && _Object$getPrototypeOf(this).constructor === constructor) {
return fn;
}
// Autobound method calling super.sameMethod() which is also autobound and so on.
if (this.constructor !== constructor && prop in this.constructor.prototype) {
return getBoundSuper(this, fn);
}
_Object$defineProperty(this, prop, {
configurable: true,
writable: true,
// NOT enumerable when it's a bound method
enumerable: false,
value: boundFn
});
return boundFn;
},
set: createDefaultSetter(prop)
};
}
var _class;

@@ -366,3 +80,3 @@

_this.version = '1.1.0';
_this.version = '1.2.0';

@@ -386,2 +100,3 @@ if (!chimeeHelper.isElement(videoElement)) throw new Error('video element passed in ' + LOG_TAG + ' must be a HTMLVideoElement, but not ' + (typeof videoElement === 'undefined' ? 'undefined' : _typeof(videoElement)));

var hlsKernel = this.hlsKernel;
/* istanbul ignore else */
if (hlsKernel) {

@@ -397,2 +112,12 @@ hlsKernel[remove ? 'off' : 'on'](HlsCore.Events.ERROR, this.hlsErrorHandler);

}, {
key: 'startLoad',
value: function startLoad() {
return this.hlsKernel.startLoad();
}
}, {
key: 'stopLoad',
value: function stopLoad() {
return this.hlsKernel.stopLoad();
}
}, {
key: 'attachMedia',

@@ -434,2 +159,3 @@ value: function attachMedia() {

this.emit(event, data);
/* istanbul ignore next */
chimeeHelper.Log.error(LOG_TAG + (event ? ' ' + event : ''), data.details);

@@ -440,4 +166,4 @@ }

return Hls;
}(chimeeHelper.CustEvent), _applyDecoratedDescriptor(_class.prototype, 'hlsErrorHandler', [autobind], _Object$getOwnPropertyDescriptor(_class.prototype, 'hlsErrorHandler'), _class.prototype), _class);
}(chimeeHelper.CustEvent), _applyDecoratedDescriptor(_class.prototype, 'hlsErrorHandler', [toxicDecorators.autobind], _Object$getOwnPropertyDescriptor(_class.prototype, 'hlsErrorHandler'), _class.prototype), _class);
module.exports = Hls;
{
"name": "chimee-kernel-hls",
"version": "1.1.0",
"version": "1.2.0",
"description": "kernel-hls of chimee",

@@ -43,7 +43,8 @@ "main": "lib/index.js",

"chimee-helper": "^0.2.2",
"hls.js": "^0.8.2"
"hls.js": "^0.8.2",
"toxic-decorators": "^0.3.8"
},
"devDependencies": {
"babel-core": "^6.26.0",
"babel-eslint": "^8.0.3",
"babel-eslint": "^8.2.1",
"babel-plugin-istanbul": "^4.1.5",

@@ -58,19 +59,20 @@ "babel-plugin-transform-decorators-legacy": "^1.3.4",

"chai": "^4.1.2",
"chimee-kernel": "^1.3.2",
"eslint": "^4.0.0",
"eslint-config-egg": "^5.1.1",
"eslint-plugin-flowtype": "^2.34.0",
"flow-bin": "^0.61.0",
"chimee-kernel": "^1.4.0",
"eslint": "^4.15.0",
"eslint-config-egg": "^6.0.0",
"eslint-plugin-flowtype": "^2.41.0",
"flow-bin": "^0.63.1",
"husky": "^0.14.3",
"karma": "^2.0.0",
"karma-coverage": "^1.1.1",
"karma-coverage-istanbul-reporter": "^1.3.0",
"karma-coverage-istanbul-reporter": "^1.3.3",
"karma-coveralls": "^1.1.2",
"karma-firefox-launcher": "^1.1.0",
"karma-mocha": "^1.3.0",
"karma-mocha-reporter": "^2.2.5",
"karma-rollup-preprocessor": "^5.0.2",
"karma-rollup-preprocessor": "^5.1.1",
"karma-sourcemap-loader": "^0.3.7",
"mocha": "^4.0.1",
"mocha": "^5.0.0",
"pkg-ok": "^1.1.0",
"rollup": "^0.52.3",
"rollup": "^0.54.1",
"rollup-plugin-babel": "^3.0.2",

@@ -81,9 +83,8 @@ "rollup-plugin-commonjs": "^8.0.2",

"rollup-plugin-livereload": "^0.6.0",
"rollup-plugin-node-resolve": "^3.0.0",
"rollup-plugin-node-resolve": "^3.0.2",
"rollup-plugin-replace": "^2.0.0",
"rollup-plugin-serve": "^0.4.0",
"rollup-plugin-uglify": "^2.0.1",
"rollup-watch": "^4.3.1",
"toxic-decorators": "^0.3.8"
"rollup-watch": "^4.3.1"
}
}

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc