Socket
Socket
Sign inDemoInstall

@sygnas/audio-src

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@sygnas/audio-src - npm Package Compare versions

Comparing version 1.1.0 to 1.1.1

439

dist/audio-src.es.js

@@ -0,1 +1,433 @@

function unwrapExports (x) {
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
}
function createCommonjsModule(fn, module) {
return module = { exports: {} }, fn(module, module.exports), module.exports;
}
var _global = createCommonjsModule(function (module) {
// https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
var global = module.exports = typeof window != 'undefined' && window.Math == Math
? window : typeof self != 'undefined' && self.Math == Math ? self
// eslint-disable-next-line no-new-func
: Function('return this')();
if (typeof __g == 'number') __g = global; // eslint-disable-line no-undef
});
var _core = createCommonjsModule(function (module) {
var core = module.exports = { version: '2.5.3' };
if (typeof __e == 'number') __e = core; // eslint-disable-line no-undef
});
var _core_1 = _core.version;
var _aFunction = function (it) {
if (typeof it != 'function') throw TypeError(it + ' is not a function!');
return it;
};
// optional / simple context binding
var _ctx = function (fn, that, length) {
_aFunction(fn);
if (that === undefined) return fn;
switch (length) {
case 1: return function (a) {
return fn.call(that, a);
};
case 2: return function (a, b) {
return fn.call(that, a, b);
};
case 3: return function (a, b, c) {
return fn.call(that, a, b, c);
};
}
return function (/* ...args */) {
return fn.apply(that, arguments);
};
};
var _isObject = function (it) {
return typeof it === 'object' ? it !== null : typeof it === 'function';
};
var _anObject = function (it) {
if (!_isObject(it)) throw TypeError(it + ' is not an object!');
return it;
};
var _fails = function (exec) {
try {
return !!exec();
} catch (e) {
return true;
}
};
// Thank's IE8 for his funny defineProperty
var _descriptors = !_fails(function () {
return Object.defineProperty({}, 'a', { get: function () { return 7; } }).a != 7;
});
var document = _global.document;
// typeof document.createElement is 'object' in old IE
var is = _isObject(document) && _isObject(document.createElement);
var _domCreate = function (it) {
return is ? document.createElement(it) : {};
};
var _ie8DomDefine = !_descriptors && !_fails(function () {
return Object.defineProperty(_domCreate('div'), 'a', { get: function () { return 7; } }).a != 7;
});
// 7.1.1 ToPrimitive(input [, PreferredType])
// instead of the ES6 spec version, we didn't implement @@toPrimitive case
// and the second argument - flag - preferred type is a string
var _toPrimitive = function (it, S) {
if (!_isObject(it)) return it;
var fn, val;
if (S && typeof (fn = it.toString) == 'function' && !_isObject(val = fn.call(it))) return val;
if (typeof (fn = it.valueOf) == 'function' && !_isObject(val = fn.call(it))) return val;
if (!S && typeof (fn = it.toString) == 'function' && !_isObject(val = fn.call(it))) return val;
throw TypeError("Can't convert object to primitive value");
};
var dP = Object.defineProperty;
var f = _descriptors ? Object.defineProperty : function defineProperty(O, P, Attributes) {
_anObject(O);
P = _toPrimitive(P, true);
_anObject(Attributes);
if (_ie8DomDefine) try {
return dP(O, P, Attributes);
} catch (e) { /* empty */ }
if ('get' in Attributes || 'set' in Attributes) throw TypeError('Accessors not supported!');
if ('value' in Attributes) O[P] = Attributes.value;
return O;
};
var _objectDp = {
f: f
};
var _propertyDesc = function (bitmap, value) {
return {
enumerable: !(bitmap & 1),
configurable: !(bitmap & 2),
writable: !(bitmap & 4),
value: value
};
};
var _hide = _descriptors ? function (object, key, value) {
return _objectDp.f(object, key, _propertyDesc(1, value));
} : function (object, key, value) {
object[key] = value;
return object;
};
var PROTOTYPE = 'prototype';
var $export = function (type, name, source) {
var IS_FORCED = type & $export.F;
var IS_GLOBAL = type & $export.G;
var IS_STATIC = type & $export.S;
var IS_PROTO = type & $export.P;
var IS_BIND = type & $export.B;
var IS_WRAP = type & $export.W;
var exports = IS_GLOBAL ? _core : _core[name] || (_core[name] = {});
var expProto = exports[PROTOTYPE];
var target = IS_GLOBAL ? _global : IS_STATIC ? _global[name] : (_global[name] || {})[PROTOTYPE];
var key, own, out;
if (IS_GLOBAL) source = name;
for (key in source) {
// contains in native
own = !IS_FORCED && target && target[key] !== undefined;
if (own && key in exports) continue;
// export native or passed
out = own ? target[key] : source[key];
// prevent global pollution for namespaces
exports[key] = IS_GLOBAL && typeof target[key] != 'function' ? source[key]
// bind timers to global for call from export context
: IS_BIND && own ? _ctx(out, _global)
// wrap global constructors for prevent change them in library
: IS_WRAP && target[key] == out ? (function (C) {
var F = function (a, b, c) {
if (this instanceof C) {
switch (arguments.length) {
case 0: return new C();
case 1: return new C(a);
case 2: return new C(a, b);
} return new C(a, b, c);
} return C.apply(this, arguments);
};
F[PROTOTYPE] = C[PROTOTYPE];
return F;
// make static versions for prototype methods
})(out) : IS_PROTO && typeof out == 'function' ? _ctx(Function.call, out) : out;
// export proto methods to core.%CONSTRUCTOR%.methods.%NAME%
if (IS_PROTO) {
(exports.virtual || (exports.virtual = {}))[key] = out;
// export proto methods to core.%CONSTRUCTOR%.prototype.%NAME%
if (type & $export.R && expProto && !expProto[key]) _hide(expProto, key, out);
}
}
};
// type bitmap
$export.F = 1; // forced
$export.G = 2; // global
$export.S = 4; // static
$export.P = 8; // proto
$export.B = 16; // bind
$export.W = 32; // wrap
$export.U = 64; // safe
$export.R = 128; // real proto method for `library`
var _export = $export;
var hasOwnProperty = {}.hasOwnProperty;
var _has = function (it, key) {
return hasOwnProperty.call(it, key);
};
var toString = {}.toString;
var _cof = function (it) {
return toString.call(it).slice(8, -1);
};
// fallback for non-array-like ES3 and non-enumerable old V8 strings
// eslint-disable-next-line no-prototype-builtins
var _iobject = Object('z').propertyIsEnumerable(0) ? Object : function (it) {
return _cof(it) == 'String' ? it.split('') : Object(it);
};
// 7.2.1 RequireObjectCoercible(argument)
var _defined = function (it) {
if (it == undefined) throw TypeError("Can't call method on " + it);
return it;
};
// to indexed object, toObject with fallback for non-array-like ES3 strings
var _toIobject = function (it) {
return _iobject(_defined(it));
};
// 7.1.4 ToInteger
var ceil = Math.ceil;
var floor = Math.floor;
var _toInteger = function (it) {
return isNaN(it = +it) ? 0 : (it > 0 ? floor : ceil)(it);
};
// 7.1.15 ToLength
var min = Math.min;
var _toLength = function (it) {
return it > 0 ? min(_toInteger(it), 0x1fffffffffffff) : 0; // pow(2, 53) - 1 == 9007199254740991
};
var max = Math.max;
var min$1 = Math.min;
var _toAbsoluteIndex = function (index, length) {
index = _toInteger(index);
return index < 0 ? max(index + length, 0) : min$1(index, length);
};
// false -> Array#indexOf
// true -> Array#includes
var _arrayIncludes = function (IS_INCLUDES) {
return function ($this, el, fromIndex) {
var O = _toIobject($this);
var length = _toLength(O.length);
var index = _toAbsoluteIndex(fromIndex, length);
var value;
// Array#includes uses SameValueZero equality algorithm
// eslint-disable-next-line no-self-compare
if (IS_INCLUDES && el != el) while (length > index) {
value = O[index++];
// eslint-disable-next-line no-self-compare
if (value != value) return true;
// Array#indexOf ignores holes, Array#includes - not
} else for (;length > index; index++) if (IS_INCLUDES || index in O) {
if (O[index] === el) return IS_INCLUDES || index || 0;
} return !IS_INCLUDES && -1;
};
};
var SHARED = '__core-js_shared__';
var store = _global[SHARED] || (_global[SHARED] = {});
var _shared = function (key) {
return store[key] || (store[key] = {});
};
var id = 0;
var px = Math.random();
var _uid = function (key) {
return 'Symbol('.concat(key === undefined ? '' : key, ')_', (++id + px).toString(36));
};
var shared = _shared('keys');
var _sharedKey = function (key) {
return shared[key] || (shared[key] = _uid(key));
};
var arrayIndexOf = _arrayIncludes(false);
var IE_PROTO = _sharedKey('IE_PROTO');
var _objectKeysInternal = function (object, names) {
var O = _toIobject(object);
var i = 0;
var result = [];
var key;
for (key in O) if (key != IE_PROTO) _has(O, key) && result.push(key);
// Don't enum bug & hidden keys
while (names.length > i) if (_has(O, key = names[i++])) {
~arrayIndexOf(result, key) || result.push(key);
}
return result;
};
// IE 8- don't enum bug keys
var _enumBugKeys = (
'constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf'
).split(',');
// 19.1.2.14 / 15.2.3.14 Object.keys(O)
var _objectKeys = Object.keys || function keys(O) {
return _objectKeysInternal(O, _enumBugKeys);
};
var f$1 = Object.getOwnPropertySymbols;
var _objectGops = {
f: f$1
};
var f$2 = {}.propertyIsEnumerable;
var _objectPie = {
f: f$2
};
// 7.1.13 ToObject(argument)
var _toObject = function (it) {
return Object(_defined(it));
};
// 19.1.2.1 Object.assign(target, source, ...)
var $assign = Object.assign;
// should work with symbols and should have deterministic property order (V8 bug)
var _objectAssign = !$assign || _fails(function () {
var A = {};
var B = {};
// eslint-disable-next-line no-undef
var S = Symbol();
var K = 'abcdefghijklmnopqrst';
A[S] = 7;
K.split('').forEach(function (k) { B[k] = k; });
return $assign({}, A)[S] != 7 || Object.keys($assign({}, B)).join('') != K;
}) ? function assign(target, source) { // eslint-disable-line no-unused-vars
var T = _toObject(target);
var aLen = arguments.length;
var index = 1;
var getSymbols = _objectGops.f;
var isEnum = _objectPie.f;
while (aLen > index) {
var S = _iobject(arguments[index++]);
var keys = getSymbols ? _objectKeys(S).concat(getSymbols(S)) : _objectKeys(S);
var length = keys.length;
var j = 0;
var key;
while (length > j) if (isEnum.call(S, key = keys[j++])) T[key] = S[key];
} return T;
} : $assign;
// 19.1.3.1 Object.assign(target, source)
_export(_export.S + _export.F, 'Object', { assign: _objectAssign });
var assign = _core.Object.assign;
var assign$2 = createCommonjsModule(function (module) {
module.exports = { "default": assign, __esModule: true };
});
var _Object$assign = unwrapExports(assign$2);
var classCallCheck = createCommonjsModule(function (module, exports) {
exports.__esModule = true;
exports.default = function (instance, Constructor) {
if (!(instance instanceof Constructor)) {
throw new TypeError("Cannot call a class as a function");
}
};
});
var _classCallCheck = unwrapExports(classCallCheck);
// 19.1.2.4 / 15.2.3.6 Object.defineProperty(O, P, Attributes)
_export(_export.S + _export.F * !_descriptors, 'Object', { defineProperty: _objectDp.f });
var $Object = _core.Object;
var defineProperty = function defineProperty(it, key, desc) {
return $Object.defineProperty(it, key, desc);
};
var defineProperty$2 = createCommonjsModule(function (module) {
module.exports = { "default": defineProperty, __esModule: true };
});
unwrapExports(defineProperty$2);
var createClass = createCommonjsModule(function (module, exports) {
exports.__esModule = true;
var _defineProperty2 = _interopRequireDefault(defineProperty$2);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
exports.default = function () {
function defineProperties(target, props) {
for (var i = 0; i < props.length; i++) {
var descriptor = props[i];
descriptor.enumerable = descriptor.enumerable || false;
descriptor.configurable = true;
if ("value" in descriptor) descriptor.writable = true;
(0, _defineProperty2.default)(target, descriptor.key, descriptor);
}
}
return function (Constructor, protoProps, staticProps) {
if (protoProps) defineProperties(Constructor.prototype, protoProps);
if (staticProps) defineProperties(Constructor, staticProps);
return Constructor;
};
}();
});
var _createClass = unwrapExports(createClass);
/**

@@ -31,6 +463,2 @@ * HDSを再生できるか

var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
/**

@@ -78,3 +506,3 @@ * ユーザー環境をチェックして、HDS / HLS / dash.js のソースを HTML5 Audio にセットする

// 設定反映
this.opt = Object.assign(defaults, config);
this.opt = _Object$assign(defaults, config);

@@ -220,2 +648,1 @@ this.audio = new Audio(); // HTML5 Audio

export default _class;
//# sourceMappingURL=audio-src.es.js.map

@@ -7,2 +7,434 @@ (function (global, factory) {

function unwrapExports (x) {
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
}
function createCommonjsModule(fn, module) {
return module = { exports: {} }, fn(module, module.exports), module.exports;
}
var _global = createCommonjsModule(function (module) {
// https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
var global = module.exports = typeof window != 'undefined' && window.Math == Math
? window : typeof self != 'undefined' && self.Math == Math ? self
// eslint-disable-next-line no-new-func
: Function('return this')();
if (typeof __g == 'number') __g = global; // eslint-disable-line no-undef
});
var _core = createCommonjsModule(function (module) {
var core = module.exports = { version: '2.5.3' };
if (typeof __e == 'number') __e = core; // eslint-disable-line no-undef
});
var _core_1 = _core.version;
var _aFunction = function (it) {
if (typeof it != 'function') throw TypeError(it + ' is not a function!');
return it;
};
// optional / simple context binding
var _ctx = function (fn, that, length) {
_aFunction(fn);
if (that === undefined) return fn;
switch (length) {
case 1: return function (a) {
return fn.call(that, a);
};
case 2: return function (a, b) {
return fn.call(that, a, b);
};
case 3: return function (a, b, c) {
return fn.call(that, a, b, c);
};
}
return function (/* ...args */) {
return fn.apply(that, arguments);
};
};
var _isObject = function (it) {
return typeof it === 'object' ? it !== null : typeof it === 'function';
};
var _anObject = function (it) {
if (!_isObject(it)) throw TypeError(it + ' is not an object!');
return it;
};
var _fails = function (exec) {
try {
return !!exec();
} catch (e) {
return true;
}
};
// Thank's IE8 for his funny defineProperty
var _descriptors = !_fails(function () {
return Object.defineProperty({}, 'a', { get: function () { return 7; } }).a != 7;
});
var document = _global.document;
// typeof document.createElement is 'object' in old IE
var is = _isObject(document) && _isObject(document.createElement);
var _domCreate = function (it) {
return is ? document.createElement(it) : {};
};
var _ie8DomDefine = !_descriptors && !_fails(function () {
return Object.defineProperty(_domCreate('div'), 'a', { get: function () { return 7; } }).a != 7;
});
// 7.1.1 ToPrimitive(input [, PreferredType])
// instead of the ES6 spec version, we didn't implement @@toPrimitive case
// and the second argument - flag - preferred type is a string
var _toPrimitive = function (it, S) {
if (!_isObject(it)) return it;
var fn, val;
if (S && typeof (fn = it.toString) == 'function' && !_isObject(val = fn.call(it))) return val;
if (typeof (fn = it.valueOf) == 'function' && !_isObject(val = fn.call(it))) return val;
if (!S && typeof (fn = it.toString) == 'function' && !_isObject(val = fn.call(it))) return val;
throw TypeError("Can't convert object to primitive value");
};
var dP = Object.defineProperty;
var f = _descriptors ? Object.defineProperty : function defineProperty(O, P, Attributes) {
_anObject(O);
P = _toPrimitive(P, true);
_anObject(Attributes);
if (_ie8DomDefine) try {
return dP(O, P, Attributes);
} catch (e) { /* empty */ }
if ('get' in Attributes || 'set' in Attributes) throw TypeError('Accessors not supported!');
if ('value' in Attributes) O[P] = Attributes.value;
return O;
};
var _objectDp = {
f: f
};
var _propertyDesc = function (bitmap, value) {
return {
enumerable: !(bitmap & 1),
configurable: !(bitmap & 2),
writable: !(bitmap & 4),
value: value
};
};
var _hide = _descriptors ? function (object, key, value) {
return _objectDp.f(object, key, _propertyDesc(1, value));
} : function (object, key, value) {
object[key] = value;
return object;
};
var PROTOTYPE = 'prototype';
var $export = function (type, name, source) {
var IS_FORCED = type & $export.F;
var IS_GLOBAL = type & $export.G;
var IS_STATIC = type & $export.S;
var IS_PROTO = type & $export.P;
var IS_BIND = type & $export.B;
var IS_WRAP = type & $export.W;
var exports = IS_GLOBAL ? _core : _core[name] || (_core[name] = {});
var expProto = exports[PROTOTYPE];
var target = IS_GLOBAL ? _global : IS_STATIC ? _global[name] : (_global[name] || {})[PROTOTYPE];
var key, own, out;
if (IS_GLOBAL) source = name;
for (key in source) {
// contains in native
own = !IS_FORCED && target && target[key] !== undefined;
if (own && key in exports) continue;
// export native or passed
out = own ? target[key] : source[key];
// prevent global pollution for namespaces
exports[key] = IS_GLOBAL && typeof target[key] != 'function' ? source[key]
// bind timers to global for call from export context
: IS_BIND && own ? _ctx(out, _global)
// wrap global constructors for prevent change them in library
: IS_WRAP && target[key] == out ? (function (C) {
var F = function (a, b, c) {
if (this instanceof C) {
switch (arguments.length) {
case 0: return new C();
case 1: return new C(a);
case 2: return new C(a, b);
} return new C(a, b, c);
} return C.apply(this, arguments);
};
F[PROTOTYPE] = C[PROTOTYPE];
return F;
// make static versions for prototype methods
})(out) : IS_PROTO && typeof out == 'function' ? _ctx(Function.call, out) : out;
// export proto methods to core.%CONSTRUCTOR%.methods.%NAME%
if (IS_PROTO) {
(exports.virtual || (exports.virtual = {}))[key] = out;
// export proto methods to core.%CONSTRUCTOR%.prototype.%NAME%
if (type & $export.R && expProto && !expProto[key]) _hide(expProto, key, out);
}
}
};
// type bitmap
$export.F = 1; // forced
$export.G = 2; // global
$export.S = 4; // static
$export.P = 8; // proto
$export.B = 16; // bind
$export.W = 32; // wrap
$export.U = 64; // safe
$export.R = 128; // real proto method for `library`
var _export = $export;
var hasOwnProperty = {}.hasOwnProperty;
var _has = function (it, key) {
return hasOwnProperty.call(it, key);
};
var toString = {}.toString;
var _cof = function (it) {
return toString.call(it).slice(8, -1);
};
// fallback for non-array-like ES3 and non-enumerable old V8 strings
// eslint-disable-next-line no-prototype-builtins
var _iobject = Object('z').propertyIsEnumerable(0) ? Object : function (it) {
return _cof(it) == 'String' ? it.split('') : Object(it);
};
// 7.2.1 RequireObjectCoercible(argument)
var _defined = function (it) {
if (it == undefined) throw TypeError("Can't call method on " + it);
return it;
};
// to indexed object, toObject with fallback for non-array-like ES3 strings
var _toIobject = function (it) {
return _iobject(_defined(it));
};
// 7.1.4 ToInteger
var ceil = Math.ceil;
var floor = Math.floor;
var _toInteger = function (it) {
return isNaN(it = +it) ? 0 : (it > 0 ? floor : ceil)(it);
};
// 7.1.15 ToLength
var min = Math.min;
var _toLength = function (it) {
return it > 0 ? min(_toInteger(it), 0x1fffffffffffff) : 0; // pow(2, 53) - 1 == 9007199254740991
};
var max = Math.max;
var min$1 = Math.min;
var _toAbsoluteIndex = function (index, length) {
index = _toInteger(index);
return index < 0 ? max(index + length, 0) : min$1(index, length);
};
// false -> Array#indexOf
// true -> Array#includes
var _arrayIncludes = function (IS_INCLUDES) {
return function ($this, el, fromIndex) {
var O = _toIobject($this);
var length = _toLength(O.length);
var index = _toAbsoluteIndex(fromIndex, length);
var value;
// Array#includes uses SameValueZero equality algorithm
// eslint-disable-next-line no-self-compare
if (IS_INCLUDES && el != el) while (length > index) {
value = O[index++];
// eslint-disable-next-line no-self-compare
if (value != value) return true;
// Array#indexOf ignores holes, Array#includes - not
} else for (;length > index; index++) if (IS_INCLUDES || index in O) {
if (O[index] === el) return IS_INCLUDES || index || 0;
} return !IS_INCLUDES && -1;
};
};
var SHARED = '__core-js_shared__';
var store = _global[SHARED] || (_global[SHARED] = {});
var _shared = function (key) {
return store[key] || (store[key] = {});
};
var id = 0;
var px = Math.random();
var _uid = function (key) {
return 'Symbol('.concat(key === undefined ? '' : key, ')_', (++id + px).toString(36));
};
var shared = _shared('keys');
var _sharedKey = function (key) {
return shared[key] || (shared[key] = _uid(key));
};
var arrayIndexOf = _arrayIncludes(false);
var IE_PROTO = _sharedKey('IE_PROTO');
var _objectKeysInternal = function (object, names) {
var O = _toIobject(object);
var i = 0;
var result = [];
var key;
for (key in O) if (key != IE_PROTO) _has(O, key) && result.push(key);
// Don't enum bug & hidden keys
while (names.length > i) if (_has(O, key = names[i++])) {
~arrayIndexOf(result, key) || result.push(key);
}
return result;
};
// IE 8- don't enum bug keys
var _enumBugKeys = (
'constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf'
).split(',');
// 19.1.2.14 / 15.2.3.14 Object.keys(O)
var _objectKeys = Object.keys || function keys(O) {
return _objectKeysInternal(O, _enumBugKeys);
};
var f$1 = Object.getOwnPropertySymbols;
var _objectGops = {
f: f$1
};
var f$2 = {}.propertyIsEnumerable;
var _objectPie = {
f: f$2
};
// 7.1.13 ToObject(argument)
var _toObject = function (it) {
return Object(_defined(it));
};
// 19.1.2.1 Object.assign(target, source, ...)
var $assign = Object.assign;
// should work with symbols and should have deterministic property order (V8 bug)
var _objectAssign = !$assign || _fails(function () {
var A = {};
var B = {};
// eslint-disable-next-line no-undef
var S = Symbol();
var K = 'abcdefghijklmnopqrst';
A[S] = 7;
K.split('').forEach(function (k) { B[k] = k; });
return $assign({}, A)[S] != 7 || Object.keys($assign({}, B)).join('') != K;
}) ? function assign(target, source) { // eslint-disable-line no-unused-vars
var T = _toObject(target);
var aLen = arguments.length;
var index = 1;
var getSymbols = _objectGops.f;
var isEnum = _objectPie.f;
while (aLen > index) {
var S = _iobject(arguments[index++]);
var keys = getSymbols ? _objectKeys(S).concat(getSymbols(S)) : _objectKeys(S);
var length = keys.length;
var j = 0;
var key;
while (length > j) if (isEnum.call(S, key = keys[j++])) T[key] = S[key];
} return T;
} : $assign;
// 19.1.3.1 Object.assign(target, source)
_export(_export.S + _export.F, 'Object', { assign: _objectAssign });
var assign = _core.Object.assign;
var assign$2 = createCommonjsModule(function (module) {
module.exports = { "default": assign, __esModule: true };
});
var _Object$assign = unwrapExports(assign$2);
var classCallCheck = createCommonjsModule(function (module, exports) {
exports.__esModule = true;
exports.default = function (instance, Constructor) {
if (!(instance instanceof Constructor)) {
throw new TypeError("Cannot call a class as a function");
}
};
});
var _classCallCheck = unwrapExports(classCallCheck);
// 19.1.2.4 / 15.2.3.6 Object.defineProperty(O, P, Attributes)
_export(_export.S + _export.F * !_descriptors, 'Object', { defineProperty: _objectDp.f });
var $Object = _core.Object;
var defineProperty = function defineProperty(it, key, desc) {
return $Object.defineProperty(it, key, desc);
};
var defineProperty$2 = createCommonjsModule(function (module) {
module.exports = { "default": defineProperty, __esModule: true };
});
unwrapExports(defineProperty$2);
var createClass = createCommonjsModule(function (module, exports) {
exports.__esModule = true;
var _defineProperty2 = _interopRequireDefault(defineProperty$2);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
exports.default = function () {
function defineProperties(target, props) {
for (var i = 0; i < props.length; i++) {
var descriptor = props[i];
descriptor.enumerable = descriptor.enumerable || false;
descriptor.configurable = true;
if ("value" in descriptor) descriptor.writable = true;
(0, _defineProperty2.default)(target, descriptor.key, descriptor);
}
}
return function (Constructor, protoProps, staticProps) {
if (protoProps) defineProperties(Constructor.prototype, protoProps);
if (staticProps) defineProperties(Constructor, staticProps);
return Constructor;
};
}();
});
var _createClass = unwrapExports(createClass);
/**

@@ -38,6 +470,2 @@ * HDSを再生できるか

var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
/**

@@ -85,3 +513,3 @@ * ユーザー環境をチェックして、HDS / HLS / dash.js のソースを HTML5 Audio にセットする

// 設定反映
this.opt = Object.assign(defaults, config);
this.opt = _Object$assign(defaults, config);

@@ -88,0 +516,0 @@ this.audio = new Audio(); // HTML5 Audio

2

dist/audio-src.min.js

@@ -1,2 +0,2 @@

!function(t,s){"object"==typeof exports&&"undefined"!=typeof module?module.exports=s():"function"==typeof define&&define.amd?define(s):t["syg-audio-src"]=s()}(this,function(){"use strict";var t=function(){function t(t,s){for(var i=0;i<s.length;i++){var e=s[i];e.enumerable=e.enumerable||!1,e.configurable=!0,"value"in e&&(e.writable=!0),Object.defineProperty(t,e.key,e)}}return function(s,i,e){return i&&t(s.prototype,i),e&&t(s,e),s}}();return function(){function s(t){!function(t,s){if(!(t instanceof s))throw new TypeError("Cannot call a class as a function")}(this,s),this.TYPE_HDS="hds",this.TYPE_HLS="hls",this.TYPE_MSE="mse",this.TYPE_FILE="file";this.opt=Object.assign({hds:{protcol:"http://",playlist:"/manifest.f4m"},hls:{protcol:"http://",playlist:"/playlist.m3u8"},mse:{protcol:"http://",playlist:"/manifest.mpd",autoplay:!1}},t),this.audio=new Audio,this.dash_player=null,this.is_support_hds=!1,this.is_support_hls=!1,this.is_support_mse=!1,this.now_type=null,this.$_check_support_result=null}return t(s,[{key:"check_support",value:function(){if(null!==this.$_check_support_result)return this.$_check_support_result;try{this.is_support_hds=function(t){return"maybe"===t.canPlayType("application/f4m+xml")}(this.audio),this.is_support_hls=function(t){return"maybe"===t.canPlayType("application/vnd.apple.mpegURL")}(this.audio),this.is_support_mse=function(){var t=null!==window.WebKitMediaSource&&void 0!==window.WebKitMediaSource,s=null!==window.MediaSource&&void 0!==window.MediaSource;return t||s}(this.audio)}catch(t){return this.$_check_support_result=!1,!1}return this.$_check_support_result=!0,!0}},{key:"set_src",value:function(t){var s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return s===this.TYPE_FILE?this.$_set_src_file(t):s===this.TYPE_HLS?this.$_set_src_hls(t):s===this.TYPE_HDS?this.$_set_src_hds(t):s===this.TYPE_MSE?this.$_set_src_mse(t):this.is_support_hls?this.$_set_src_hls(t):this.is_support_hds?this.$_set_src_hds(t):!!this.is_support_mse&&this.$_set_src_mse(t)}},{key:"$_set_src_file",value:function(t){return this.audio.src=t,this.now_type=this.TYPE_FILE,!0}},{key:"$_set_src_hls",value:function(t){return!!this.is_support_hls&&(this.audio.src=this.opt.hls.protcol+t+this.opt.hls.playlist,this.now_type=this.TYPE_HLS,!0)}},{key:"$_set_src_hds",value:function(t){return!!this.is_support_hds&&(this.audio.src=this.opt.hds.protcol+t+this.opt.hds.playlist,this.now_type=this.TYPE_HDS,!0)}},{key:"$_set_src_mse",value:function(t){if(!this.is_support_mse)return!1;this.now_type=this.TYPE_MSE;var s=this.opt.mse.protcol+t+this.opt.mse.playlist;return null===this.dash_player?(this.dash_player=dashjs.MediaPlayer().create(),this.dash_player.initialize(this.audio,s,this.opt.mse.autoplay)):this.dash_player.attachSource(s),!0}}]),s}()});
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):t["syg-audio-src"]=e()}(this,function(){"use strict";function t(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function e(t,e){return t(e={exports:{}},e.exports),e.exports}var r=e(function(t){var e=t.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=e)}),n=e(function(t){var e=t.exports={version:"2.5.3"};"number"==typeof __e&&(__e=e)}),i=(n.version,function(t,e,r){if(function(t){if("function"!=typeof t)throw TypeError(t+" is not a function!")}(t),void 0===e)return t;switch(r){case 1:return function(r){return t.call(e,r)};case 2:return function(r,n){return t.call(e,r,n)};case 3:return function(r,n,i){return t.call(e,r,n,i)}}return function(){return t.apply(e,arguments)}}),o=function(t){return"object"==typeof t?null!==t:"function"==typeof t},s=function(t){if(!o(t))throw TypeError(t+" is not an object!");return t},u=function(t){try{return!!t()}catch(t){return!0}},c=!u(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a}),a=r.document,l=o(a)&&o(a.createElement),f=!c&&!u(function(){return 7!=Object.defineProperty((t="div",l?a.createElement(t):{}),"a",{get:function(){return 7}}).a;var t}),p=Object.defineProperty,h={f:c?Object.defineProperty:function(t,e,r){if(s(t),e=function(t,e){if(!o(t))return t;var r,n;if(e&&"function"==typeof(r=t.toString)&&!o(n=r.call(t)))return n;if("function"==typeof(r=t.valueOf)&&!o(n=r.call(t)))return n;if(!e&&"function"==typeof(r=t.toString)&&!o(n=r.call(t)))return n;throw TypeError("Can't convert object to primitive value")}(e,!0),s(r),f)try{return p(t,e,r)}catch(t){}if("get"in r||"set"in r)throw TypeError("Accessors not supported!");return"value"in r&&(t[e]=r.value),t}},_=c?function(t,e,r){return h.f(t,e,function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}(1,r))}:function(t,e,r){return t[e]=r,t},d=function(t,e,o){var s,u,c,a=t&d.F,l=t&d.G,f=t&d.S,p=t&d.P,h=t&d.B,y=t&d.W,v=l?n:n[e]||(n[e]={}),m=v.prototype,b=l?r:f?r[e]:(r[e]||{}).prototype;for(s in l&&(o=e),o)(u=!a&&b&&void 0!==b[s])&&s in v||(c=u?b[s]:o[s],v[s]=l&&"function"!=typeof b[s]?o[s]:h&&u?i(c,r):y&&b[s]==c?function(t){var e=function(e,r,n){if(this instanceof t){switch(arguments.length){case 0:return new t;case 1:return new t(e);case 2:return new t(e,r)}return new t(e,r,n)}return t.apply(this,arguments)};return e.prototype=t.prototype,e}(c):p&&"function"==typeof c?i(Function.call,c):c,p&&((v.virtual||(v.virtual={}))[s]=c,t&d.R&&m&&!m[s]&&_(m,s,c)))};d.F=1,d.G=2,d.S=4,d.P=8,d.B=16,d.W=32,d.U=64,d.R=128;var y,v,m=d,b={}.hasOwnProperty,w=function(t,e){return b.call(t,e)},E={}.toString,P=Object("z").propertyIsEnumerable(0)?Object:function(t){return"String"==function(t){return E.call(t).slice(8,-1)}(t)?t.split(""):Object(t)},g=function(t){if(void 0==t)throw TypeError("Can't call method on "+t);return t},S=function(t){return P(g(t))},j=Math.ceil,O=Math.floor,M=function(t){return isNaN(t=+t)?0:(t>0?O:j)(t)},T=Math.min,k=Math.max,$=Math.min,Y=r["__core-js_shared__"]||(r["__core-js_shared__"]={}),x=0,F=Math.random(),L=Y[y="keys"]||(Y[y]={}),I=(v=!1,function(t,e,r){var n,i,o=S(t),s=(n=o.length)>0?T(M(n),9007199254740991):0,u=function(t,e){return(t=M(t))<0?k(t+e,0):$(t,e)}(r,s);if(v&&e!=e){for(;s>u;)if((i=o[u++])!=i)return!0}else for(;s>u;u++)if((v||u in o)&&o[u]===e)return v||u||0;return!v&&-1}),H=function(t){return L[t]||(L[t]=function(t){return"Symbol(".concat(void 0===t?"":t,")_",(++x+F).toString(36))}(t))}("IE_PROTO"),R="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(","),W=Object.keys||function(t){return function(t,e){var r,n=S(t),i=0,o=[];for(r in n)r!=H&&w(n,r)&&o.push(r);for(;e.length>i;)w(n,r=e[i++])&&(~I(o,r)||o.push(r));return o}(t,R)},C={f:Object.getOwnPropertySymbols},D={f:{}.propertyIsEnumerable},z=Object.assign,A=!z||u(function(){var t={},e={},r=Symbol(),n="abcdefghijklmnopqrst";return t[r]=7,n.split("").forEach(function(t){e[t]=t}),7!=z({},t)[r]||Object.keys(z({},e)).join("")!=n})?function(t,e){for(var r=Object(g(t)),n=arguments.length,i=1,o=C.f,s=D.f;n>i;)for(var u,c=P(arguments[i++]),a=o?W(c).concat(o(c)):W(c),l=a.length,f=0;l>f;)s.call(c,u=a[f++])&&(r[u]=c[u]);return r}:z;m(m.S+m.F,"Object",{assign:A});var B=n.Object.assign,G=t(e(function(t){t.exports={default:B,__esModule:!0}})),K=t(e(function(t,e){e.__esModule=!0,e.default=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}}));m(m.S+m.F*!c,"Object",{defineProperty:h.f});var N=n.Object,U=function(t,e,r){return N.defineProperty(t,e,r)},q=e(function(t){t.exports={default:U,__esModule:!0}});t(q);var J=t(e(function(t,e){e.__esModule=!0;var r,n=(r=q)&&r.__esModule?r:{default:r};e.default=function(){function t(t,e){for(var r=0;r<e.length;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),(0,n.default)(t,i.key,i)}}return function(e,r,n){return r&&t(e.prototype,r),n&&t(e,n),e}}()}));return function(){function t(e){K(this,t),this.TYPE_HDS="hds",this.TYPE_HLS="hls",this.TYPE_MSE="mse",this.TYPE_FILE="file";this.opt=G({hds:{protcol:"http://",playlist:"/manifest.f4m"},hls:{protcol:"http://",playlist:"/playlist.m3u8"},mse:{protcol:"http://",playlist:"/manifest.mpd",autoplay:!1}},e),this.audio=new Audio,this.dash_player=null,this.is_support_hds=!1,this.is_support_hls=!1,this.is_support_mse=!1,this.now_type=null,this.$_check_support_result=null}return J(t,[{key:"check_support",value:function(){if(null!==this.$_check_support_result)return this.$_check_support_result;try{this.is_support_hds="maybe"===this.audio.canPlayType("application/f4m+xml"),this.is_support_hls=function(t){return"maybe"===t.canPlayType("application/vnd.apple.mpegURL")}(this.audio),this.is_support_mse=(this.audio,t=null!==window.WebKitMediaSource&&void 0!==window.WebKitMediaSource,e=null!==window.MediaSource&&void 0!==window.MediaSource,t||e)}catch(t){return this.$_check_support_result=!1,!1}var t,e;return this.$_check_support_result=!0,!0}},{key:"set_src",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return e===this.TYPE_FILE?this.$_set_src_file(t):e===this.TYPE_HLS?this.$_set_src_hls(t):e===this.TYPE_HDS?this.$_set_src_hds(t):e===this.TYPE_MSE?this.$_set_src_mse(t):this.is_support_hls?this.$_set_src_hls(t):this.is_support_hds?this.$_set_src_hds(t):!!this.is_support_mse&&this.$_set_src_mse(t)}},{key:"$_set_src_file",value:function(t){return this.audio.src=t,this.now_type=this.TYPE_FILE,!0}},{key:"$_set_src_hls",value:function(t){return!!this.is_support_hls&&(this.audio.src=this.opt.hls.protcol+t+this.opt.hls.playlist,this.now_type=this.TYPE_HLS,!0)}},{key:"$_set_src_hds",value:function(t){return!!this.is_support_hds&&(this.audio.src=this.opt.hds.protcol+t+this.opt.hds.playlist,this.now_type=this.TYPE_HDS,!0)}},{key:"$_set_src_mse",value:function(t){if(!this.is_support_mse)return!1;this.now_type=this.TYPE_MSE;var e=this.opt.mse.protcol+t+this.opt.mse.playlist;return null===this.dash_player?(this.dash_player=dashjs.MediaPlayer().create(),this.dash_player.initialize(this.audio,e,this.opt.mse.autoplay)):this.dash_player.attachSource(e),!0}}]),t}()});
//# sourceMappingURL=audio-src.min.js.map
{
"name": "@sygnas/audio-src",
"version": "1.1.0",
"version": "1.1.1",
"description": "Check user environment and set HTML5 Audio from HDS / HLS / dash.js",

@@ -28,23 +28,21 @@ "main": "dist/audio-src.js",

"stream"
],
"author": "Hiroshi Fukuda <info.sygnas@gmail.com>",
], "author": "Hiroshi Fukuda <info.sygnas@gmail.com>",
"license": "MIT",
"devDependencies": {
"babel-core": "^6.26.0",
"babel-eslint": "^8.0.3",
"babel-eslint": "^8.2.1",
"babel-plugin-external-helpers": "^6.22.0",
"babel-preset-es2015": "^6.24.1",
"eslint": "^4.12.1",
"eslint-config-airbnb": "^16.1.0",
"eslint-plugin-import": "^2.8.0",
"eslint-plugin-jsx-a11y": "^6.0.3",
"eslint-plugin-react": "^7.5.1",
"rollup": "^0.52.0",
"rollup-plugin-babel": "^3.0.2",
"rollup-plugin-node-resolve": "^3.0.0",
"babel-plugin-transform-runtime": "^6.23.0",
"babel-preset-env": "^1.6.1",
"babel-runtime": "^6.26.0",
"eslint": "^4.17.0",
"rollup": "^0.55.3",
"rollup-plugin-babel": "^3.0.3",
"rollup-plugin-commonjs": "^8.3.0",
"rollup-plugin-node-resolve": "^3.0.2",
"rollup-plugin-sourcemaps": "^0.4.2",
"rollup-plugin-uglify": "^2.0.1",
"rollup-watch": "^4.3.1"
"rollup-plugin-uglify": "^3.0.0"
},
"dependencies": {}
"dependencies": {
}
}

@@ -5,2 +5,3 @@ import babel from 'rollup-plugin-babel';

import resolve from 'rollup-plugin-node-resolve';
import commonjs from 'rollup-plugin-commonjs';

@@ -10,50 +11,50 @@ const packages = require('./package.json');

const paths = {
root: '/',
source: {
root: './src/',
},
dist: {
root: './dist/',
},
root: '/',
source: {
root: './src/',
},
dist: {
root: './dist/',
},
};
let fileName,
Configure;
const fileName = process.env.NODE_ENV !== 'production' ? 'audio-src' : 'audio-src.min';
fileName = process.env.NODE_ENV !== 'production' ? 'audio-src' : 'audio-src.min';
Configure = {
input: `${paths.source.root}index.js`,
sourcemap: true,
moduleId: packages.moduleName,
name: packages.moduleName,
output: [{
file: `${paths.dist.root}${fileName}.js`,
format: 'umd',
}],
// targets: [{
// dest: `${paths.dist.root}${fileName}.js`,
// format: 'umd',
// }],
plugins: [
babel(),
sourcemaps(),
resolve(),
],
external: [
'axios',
'csv-string',
'csv-string/lib/parser',
],
const Configure = {
input: `${paths.source.root}index.js`,
output: [
{
file: `${paths.dist.root}${fileName}.js`,
format: 'umd',
name: packages.moduleName,
sourcemap: true,
}
],
plugins: [
babel({
plugins: ['external-helpers'],
externalHelpers: true,
runtimeHelpers: true,
exclude: 'node_modules/**'
}),
commonjs({
include: 'node_modules/**'
}),
sourcemaps(),
resolve(),
],
external: [
'@sygnas/throttle',
],
};
if (process.env.NODE_ENV === 'production') {
Configure.plugins.push(uglify());
Configure.plugins.push(uglify());
} else {
Configure.output.push({
file: `${paths.dist.root}${fileName}.es.js`,
format: 'es',
});
Configure.output.push({
file: `${paths.dist.root}${fileName}.es.js`,
format: 'es',
});
}
export default Configure;
export default Configure;

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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