code
stringlengths
24
2.07M
docstring
stringlengths
25
85.3k
func_name
stringlengths
1
92
language
stringclasses
1 value
repo
stringlengths
5
64
path
stringlengths
4
172
url
stringlengths
44
218
license
stringclasses
7 values
function to(time, withoutSuffix) { if ( this.isValid() && ((isMoment(time) && time.isValid()) || createLocal(time).isValid()) ) { return createDuration({ from: this, to: time }) .locale(this.locale()) .humanize(!withoutSuffix); ...
Return a human readable representation of a moment that can also be evaluated to get a new moment which is the same @link https://nodejs.org/dist/latest/docs/api/util.html#util_custom_inspect_function_on_objects
to
javascript
gongfuxiang/shopxo
public/static/common/lib/ckplayer/hls.js/hls-demo.js
https://github.com/gongfuxiang/shopxo/blob/master/public/static/common/lib/ckplayer/hls.js/hls-demo.js
MIT
function toNow(withoutSuffix) { return this.to(createLocal(), withoutSuffix); }
Return a human readable representation of a moment that can also be evaluated to get a new moment which is the same @link https://nodejs.org/dist/latest/docs/api/util.html#util_custom_inspect_function_on_objects
toNow
javascript
gongfuxiang/shopxo
public/static/common/lib/ckplayer/hls.js/hls-demo.js
https://github.com/gongfuxiang/shopxo/blob/master/public/static/common/lib/ckplayer/hls.js/hls-demo.js
MIT
function locale(key) { var newLocaleData; if (key === undefined) { return this._locale._abbr; } else { newLocaleData = getLocale(key); if (newLocaleData != null) { this._locale = newLocaleData; } return this; } ...
Return a human readable representation of a moment that can also be evaluated to get a new moment which is the same @link https://nodejs.org/dist/latest/docs/api/util.html#util_custom_inspect_function_on_objects
locale
javascript
gongfuxiang/shopxo
public/static/common/lib/ckplayer/hls.js/hls-demo.js
https://github.com/gongfuxiang/shopxo/blob/master/public/static/common/lib/ckplayer/hls.js/hls-demo.js
MIT
function localeData() { return this._locale; }
Return a human readable representation of a moment that can also be evaluated to get a new moment which is the same @link https://nodejs.org/dist/latest/docs/api/util.html#util_custom_inspect_function_on_objects
localeData
javascript
gongfuxiang/shopxo
public/static/common/lib/ckplayer/hls.js/hls-demo.js
https://github.com/gongfuxiang/shopxo/blob/master/public/static/common/lib/ckplayer/hls.js/hls-demo.js
MIT
function mod$1(dividend, divisor) { return ((dividend % divisor) + divisor) % divisor; }
Return a human readable representation of a moment that can also be evaluated to get a new moment which is the same @link https://nodejs.org/dist/latest/docs/api/util.html#util_custom_inspect_function_on_objects
mod$1
javascript
gongfuxiang/shopxo
public/static/common/lib/ckplayer/hls.js/hls-demo.js
https://github.com/gongfuxiang/shopxo/blob/master/public/static/common/lib/ckplayer/hls.js/hls-demo.js
MIT
function localStartOfDate(y, m, d) { // the date constructor remaps years 0-99 to 1900-1999 if (y < 100 && y >= 0) { // preserve leap years using a full 400 year cycle, then reset return new Date(y + 400, m, d) - MS_PER_400_YEARS; } else { return new Date(y, m...
Return a human readable representation of a moment that can also be evaluated to get a new moment which is the same @link https://nodejs.org/dist/latest/docs/api/util.html#util_custom_inspect_function_on_objects
localStartOfDate
javascript
gongfuxiang/shopxo
public/static/common/lib/ckplayer/hls.js/hls-demo.js
https://github.com/gongfuxiang/shopxo/blob/master/public/static/common/lib/ckplayer/hls.js/hls-demo.js
MIT
function utcStartOfDate(y, m, d) { // Date.UTC remaps years 0-99 to 1900-1999 if (y < 100 && y >= 0) { // preserve leap years using a full 400 year cycle, then reset return Date.UTC(y + 400, m, d) - MS_PER_400_YEARS; } else { return Date.UTC(y, m, d); ...
Return a human readable representation of a moment that can also be evaluated to get a new moment which is the same @link https://nodejs.org/dist/latest/docs/api/util.html#util_custom_inspect_function_on_objects
utcStartOfDate
javascript
gongfuxiang/shopxo
public/static/common/lib/ckplayer/hls.js/hls-demo.js
https://github.com/gongfuxiang/shopxo/blob/master/public/static/common/lib/ckplayer/hls.js/hls-demo.js
MIT
function startOf(units) { var time, startOfDate; units = normalizeUnits(units); if (units === undefined || units === 'millisecond' || !this.isValid()) { return this; } startOfDate = this._isUTC ? utcStartOfDate : localStartOfDate; switch (units) { ...
Return a human readable representation of a moment that can also be evaluated to get a new moment which is the same @link https://nodejs.org/dist/latest/docs/api/util.html#util_custom_inspect_function_on_objects
startOf
javascript
gongfuxiang/shopxo
public/static/common/lib/ckplayer/hls.js/hls-demo.js
https://github.com/gongfuxiang/shopxo/blob/master/public/static/common/lib/ckplayer/hls.js/hls-demo.js
MIT
function endOf(units) { var time, startOfDate; units = normalizeUnits(units); if (units === undefined || units === 'millisecond' || !this.isValid()) { return this; } startOfDate = this._isUTC ? utcStartOfDate : localStartOfDate; switch (units) { ...
Return a human readable representation of a moment that can also be evaluated to get a new moment which is the same @link https://nodejs.org/dist/latest/docs/api/util.html#util_custom_inspect_function_on_objects
endOf
javascript
gongfuxiang/shopxo
public/static/common/lib/ckplayer/hls.js/hls-demo.js
https://github.com/gongfuxiang/shopxo/blob/master/public/static/common/lib/ckplayer/hls.js/hls-demo.js
MIT
function valueOf() { return this._d.valueOf() - (this._offset || 0) * 60000; }
Return a human readable representation of a moment that can also be evaluated to get a new moment which is the same @link https://nodejs.org/dist/latest/docs/api/util.html#util_custom_inspect_function_on_objects
valueOf
javascript
gongfuxiang/shopxo
public/static/common/lib/ckplayer/hls.js/hls-demo.js
https://github.com/gongfuxiang/shopxo/blob/master/public/static/common/lib/ckplayer/hls.js/hls-demo.js
MIT
function unix() { return Math.floor(this.valueOf() / 1000); }
Return a human readable representation of a moment that can also be evaluated to get a new moment which is the same @link https://nodejs.org/dist/latest/docs/api/util.html#util_custom_inspect_function_on_objects
unix
javascript
gongfuxiang/shopxo
public/static/common/lib/ckplayer/hls.js/hls-demo.js
https://github.com/gongfuxiang/shopxo/blob/master/public/static/common/lib/ckplayer/hls.js/hls-demo.js
MIT
function toDate() { return new Date(this.valueOf()); }
Return a human readable representation of a moment that can also be evaluated to get a new moment which is the same @link https://nodejs.org/dist/latest/docs/api/util.html#util_custom_inspect_function_on_objects
toDate
javascript
gongfuxiang/shopxo
public/static/common/lib/ckplayer/hls.js/hls-demo.js
https://github.com/gongfuxiang/shopxo/blob/master/public/static/common/lib/ckplayer/hls.js/hls-demo.js
MIT
function toArray() { var m = this; return [ m.year(), m.month(), m.date(), m.hour(), m.minute(), m.second(), m.millisecond(), ]; }
Return a human readable representation of a moment that can also be evaluated to get a new moment which is the same @link https://nodejs.org/dist/latest/docs/api/util.html#util_custom_inspect_function_on_objects
toArray
javascript
gongfuxiang/shopxo
public/static/common/lib/ckplayer/hls.js/hls-demo.js
https://github.com/gongfuxiang/shopxo/blob/master/public/static/common/lib/ckplayer/hls.js/hls-demo.js
MIT
function toObject() { var m = this; return { years: m.year(), months: m.month(), date: m.date(), hours: m.hours(), minutes: m.minutes(), seconds: m.seconds(), milliseconds: m.milliseconds(), }; }
Return a human readable representation of a moment that can also be evaluated to get a new moment which is the same @link https://nodejs.org/dist/latest/docs/api/util.html#util_custom_inspect_function_on_objects
toObject
javascript
gongfuxiang/shopxo
public/static/common/lib/ckplayer/hls.js/hls-demo.js
https://github.com/gongfuxiang/shopxo/blob/master/public/static/common/lib/ckplayer/hls.js/hls-demo.js
MIT
function toJSON() { // new Date(NaN).toJSON() === null return this.isValid() ? this.toISOString() : null; }
Return a human readable representation of a moment that can also be evaluated to get a new moment which is the same @link https://nodejs.org/dist/latest/docs/api/util.html#util_custom_inspect_function_on_objects
toJSON
javascript
gongfuxiang/shopxo
public/static/common/lib/ckplayer/hls.js/hls-demo.js
https://github.com/gongfuxiang/shopxo/blob/master/public/static/common/lib/ckplayer/hls.js/hls-demo.js
MIT
function isValid$2() { return isValid(this); }
Return a human readable representation of a moment that can also be evaluated to get a new moment which is the same @link https://nodejs.org/dist/latest/docs/api/util.html#util_custom_inspect_function_on_objects
isValid$2
javascript
gongfuxiang/shopxo
public/static/common/lib/ckplayer/hls.js/hls-demo.js
https://github.com/gongfuxiang/shopxo/blob/master/public/static/common/lib/ckplayer/hls.js/hls-demo.js
MIT
function parsingFlags() { return extend({}, getParsingFlags(this)); }
Return a human readable representation of a moment that can also be evaluated to get a new moment which is the same @link https://nodejs.org/dist/latest/docs/api/util.html#util_custom_inspect_function_on_objects
parsingFlags
javascript
gongfuxiang/shopxo
public/static/common/lib/ckplayer/hls.js/hls-demo.js
https://github.com/gongfuxiang/shopxo/blob/master/public/static/common/lib/ckplayer/hls.js/hls-demo.js
MIT
function invalidAt() { return getParsingFlags(this).overflow; }
Return a human readable representation of a moment that can also be evaluated to get a new moment which is the same @link https://nodejs.org/dist/latest/docs/api/util.html#util_custom_inspect_function_on_objects
invalidAt
javascript
gongfuxiang/shopxo
public/static/common/lib/ckplayer/hls.js/hls-demo.js
https://github.com/gongfuxiang/shopxo/blob/master/public/static/common/lib/ckplayer/hls.js/hls-demo.js
MIT
function creationData() { return { input: this._i, format: this._f, locale: this._locale, isUTC: this._isUTC, strict: this._strict, }; }
Return a human readable representation of a moment that can also be evaluated to get a new moment which is the same @link https://nodejs.org/dist/latest/docs/api/util.html#util_custom_inspect_function_on_objects
creationData
javascript
gongfuxiang/shopxo
public/static/common/lib/ckplayer/hls.js/hls-demo.js
https://github.com/gongfuxiang/shopxo/blob/master/public/static/common/lib/ckplayer/hls.js/hls-demo.js
MIT
function localeEras(m, format) { var i, l, date, eras = this._eras || getLocale('en')._eras; for (i = 0, l = eras.length; i < l; ++i) { switch (typeof eras[i].since) { case 'string': // truncate time ...
Return a human readable representation of a moment that can also be evaluated to get a new moment which is the same @link https://nodejs.org/dist/latest/docs/api/util.html#util_custom_inspect_function_on_objects
localeEras
javascript
gongfuxiang/shopxo
public/static/common/lib/ckplayer/hls.js/hls-demo.js
https://github.com/gongfuxiang/shopxo/blob/master/public/static/common/lib/ckplayer/hls.js/hls-demo.js
MIT
function localeErasParse(eraName, format, strict) { var i, l, eras = this.eras(), name, abbr, narrow; eraName = eraName.toUpperCase(); for (i = 0, l = eras.length; i < l; ++i) { name = eras[i].name.toUpperCase(); ...
Return a human readable representation of a moment that can also be evaluated to get a new moment which is the same @link https://nodejs.org/dist/latest/docs/api/util.html#util_custom_inspect_function_on_objects
localeErasParse
javascript
gongfuxiang/shopxo
public/static/common/lib/ckplayer/hls.js/hls-demo.js
https://github.com/gongfuxiang/shopxo/blob/master/public/static/common/lib/ckplayer/hls.js/hls-demo.js
MIT
function localeErasConvertYear(era, year) { var dir = era.since <= era.until ? +1 : -1; if (year === undefined) { return hooks(era.since).year(); } else { return hooks(era.since).year() + (year - era.offset) * dir; } }
Return a human readable representation of a moment that can also be evaluated to get a new moment which is the same @link https://nodejs.org/dist/latest/docs/api/util.html#util_custom_inspect_function_on_objects
localeErasConvertYear
javascript
gongfuxiang/shopxo
public/static/common/lib/ckplayer/hls.js/hls-demo.js
https://github.com/gongfuxiang/shopxo/blob/master/public/static/common/lib/ckplayer/hls.js/hls-demo.js
MIT
function getEraName() { var i, l, val, eras = this.localeData().eras(); for (i = 0, l = eras.length; i < l; ++i) { // truncate time val = this.clone().startOf('day').valueOf(); if (eras[i].since <= val && val <= eras[i].until) { ...
Return a human readable representation of a moment that can also be evaluated to get a new moment which is the same @link https://nodejs.org/dist/latest/docs/api/util.html#util_custom_inspect_function_on_objects
getEraName
javascript
gongfuxiang/shopxo
public/static/common/lib/ckplayer/hls.js/hls-demo.js
https://github.com/gongfuxiang/shopxo/blob/master/public/static/common/lib/ckplayer/hls.js/hls-demo.js
MIT
function getEraNarrow() { var i, l, val, eras = this.localeData().eras(); for (i = 0, l = eras.length; i < l; ++i) { // truncate time val = this.clone().startOf('day').valueOf(); if (eras[i].since <= val && val <= eras[i].until) { ...
Return a human readable representation of a moment that can also be evaluated to get a new moment which is the same @link https://nodejs.org/dist/latest/docs/api/util.html#util_custom_inspect_function_on_objects
getEraNarrow
javascript
gongfuxiang/shopxo
public/static/common/lib/ckplayer/hls.js/hls-demo.js
https://github.com/gongfuxiang/shopxo/blob/master/public/static/common/lib/ckplayer/hls.js/hls-demo.js
MIT
function getEraAbbr() { var i, l, val, eras = this.localeData().eras(); for (i = 0, l = eras.length; i < l; ++i) { // truncate time val = this.clone().startOf('day').valueOf(); if (eras[i].since <= val && val <= eras[i].until) { ...
Return a human readable representation of a moment that can also be evaluated to get a new moment which is the same @link https://nodejs.org/dist/latest/docs/api/util.html#util_custom_inspect_function_on_objects
getEraAbbr
javascript
gongfuxiang/shopxo
public/static/common/lib/ckplayer/hls.js/hls-demo.js
https://github.com/gongfuxiang/shopxo/blob/master/public/static/common/lib/ckplayer/hls.js/hls-demo.js
MIT
function getEraYear() { var i, l, dir, val, eras = this.localeData().eras(); for (i = 0, l = eras.length; i < l; ++i) { dir = eras[i].since <= eras[i].until ? +1 : -1; // truncate time val = this.clone().startOf('day')....
Return a human readable representation of a moment that can also be evaluated to get a new moment which is the same @link https://nodejs.org/dist/latest/docs/api/util.html#util_custom_inspect_function_on_objects
getEraYear
javascript
gongfuxiang/shopxo
public/static/common/lib/ckplayer/hls.js/hls-demo.js
https://github.com/gongfuxiang/shopxo/blob/master/public/static/common/lib/ckplayer/hls.js/hls-demo.js
MIT
function getSetDayOfYear(input) { var dayOfYear = Math.round( (this.clone().startOf('day') - this.clone().startOf('year')) / 864e5 ) + 1; return input == null ? dayOfYear : this.add(input - dayOfYear, 'd'); }
Take a potentially misbehaving resolver function and make sure onFulfilled and onRejected are only called once. Makes no guarantees about asynchrony.
getSetDayOfYear
javascript
gongfuxiang/shopxo
public/static/common/lib/ckplayer/hls.js/hls-demo.js
https://github.com/gongfuxiang/shopxo/blob/master/public/static/common/lib/ckplayer/hls.js/hls-demo.js
MIT
function createUnix(input) { return createLocal(input * 1000); }
@param {Object} target @param {Object} [config] @returns {{url: string, description: string, live: boolean, abr: boolean, skip_ua: string[]}}
createUnix
javascript
gongfuxiang/shopxo
public/static/common/lib/ckplayer/hls.js/hls-demo.js
https://github.com/gongfuxiang/shopxo/blob/master/public/static/common/lib/ckplayer/hls.js/hls-demo.js
MIT
function createInZone() { return createLocal.apply(null, arguments).parseZone(); }
@param {Object} target @param {Object} [config] @returns {{url: string, description: string, live: boolean, abr: boolean, skip_ua: string[]}}
createInZone
javascript
gongfuxiang/shopxo
public/static/common/lib/ckplayer/hls.js/hls-demo.js
https://github.com/gongfuxiang/shopxo/blob/master/public/static/common/lib/ckplayer/hls.js/hls-demo.js
MIT
function preParsePostFormat(string) { return string; }
@param {Object} target @param {Object} [config] @returns {{url: string, description: string, live: boolean, abr: boolean, skip_ua: string[]}}
preParsePostFormat
javascript
gongfuxiang/shopxo
public/static/common/lib/ckplayer/hls.js/hls-demo.js
https://github.com/gongfuxiang/shopxo/blob/master/public/static/common/lib/ckplayer/hls.js/hls-demo.js
MIT
function get$1(format, index, field, setter) { var locale = getLocale(), utc = createUTC().set(setter, index); return locale[field](utc, format); }
@param {Object} target @param {Object} [config] @returns {{url: string, description: string, live: boolean, abr: boolean, skip_ua: string[]}}
get$1
javascript
gongfuxiang/shopxo
public/static/common/lib/ckplayer/hls.js/hls-demo.js
https://github.com/gongfuxiang/shopxo/blob/master/public/static/common/lib/ckplayer/hls.js/hls-demo.js
MIT
function listMonthsImpl(format, index, field) { if (isNumber(format)) { index = format; format = undefined; } format = format || ''; if (index != null) { return get$1(format, index, field, 'month'); } var i, out = []; ...
@param {Object} target @param {Object} [config] @returns {{url: string, description: string, live: boolean, abr: boolean, skip_ua: string[]}}
listMonthsImpl
javascript
gongfuxiang/shopxo
public/static/common/lib/ckplayer/hls.js/hls-demo.js
https://github.com/gongfuxiang/shopxo/blob/master/public/static/common/lib/ckplayer/hls.js/hls-demo.js
MIT
function listWeekdaysImpl(localeSorted, format, index, field) { if (typeof localeSorted === 'boolean') { if (isNumber(format)) { index = format; format = undefined; } format = format || ''; } else { format = localeSorted; ...
@param {Object} target @param {Object} [config] @returns {{url: string, description: string, live: boolean, abr: boolean, skip_ua: string[]}}
listWeekdaysImpl
javascript
gongfuxiang/shopxo
public/static/common/lib/ckplayer/hls.js/hls-demo.js
https://github.com/gongfuxiang/shopxo/blob/master/public/static/common/lib/ckplayer/hls.js/hls-demo.js
MIT
function listMonths(format, index) { return listMonthsImpl(format, index, 'months'); }
@param {Object} target @param {Object} [config] @returns {{url: string, description: string, live: boolean, abr: boolean, skip_ua: string[]}}
listMonths
javascript
gongfuxiang/shopxo
public/static/common/lib/ckplayer/hls.js/hls-demo.js
https://github.com/gongfuxiang/shopxo/blob/master/public/static/common/lib/ckplayer/hls.js/hls-demo.js
MIT
function listMonthsShort(format, index) { return listMonthsImpl(format, index, 'monthsShort'); }
@param {Object} target @param {Object} [config] @returns {{url: string, description: string, live: boolean, abr: boolean, skip_ua: string[]}}
listMonthsShort
javascript
gongfuxiang/shopxo
public/static/common/lib/ckplayer/hls.js/hls-demo.js
https://github.com/gongfuxiang/shopxo/blob/master/public/static/common/lib/ckplayer/hls.js/hls-demo.js
MIT
function listWeekdays(localeSorted, format, index) { return listWeekdaysImpl(localeSorted, format, index, 'weekdays'); }
@param {Object} target @param {Object} [config] @returns {{url: string, description: string, live: boolean, abr: boolean, skip_ua: string[]}}
listWeekdays
javascript
gongfuxiang/shopxo
public/static/common/lib/ckplayer/hls.js/hls-demo.js
https://github.com/gongfuxiang/shopxo/blob/master/public/static/common/lib/ckplayer/hls.js/hls-demo.js
MIT
function listWeekdaysShort(localeSorted, format, index) { return listWeekdaysImpl(localeSorted, format, index, 'weekdaysShort'); }
@param {Object} target @param {Object} [config] @returns {{url: string, description: string, live: boolean, abr: boolean, skip_ua: string[]}}
listWeekdaysShort
javascript
gongfuxiang/shopxo
public/static/common/lib/ckplayer/hls.js/hls-demo.js
https://github.com/gongfuxiang/shopxo/blob/master/public/static/common/lib/ckplayer/hls.js/hls-demo.js
MIT
function listWeekdaysMin(localeSorted, format, index) { return listWeekdaysImpl(localeSorted, format, index, 'weekdaysMin'); }
@param {Object} target @param {Object} [config] @returns {{url: string, description: string, live: boolean, abr: boolean, skip_ua: string[]}}
listWeekdaysMin
javascript
gongfuxiang/shopxo
public/static/common/lib/ckplayer/hls.js/hls-demo.js
https://github.com/gongfuxiang/shopxo/blob/master/public/static/common/lib/ckplayer/hls.js/hls-demo.js
MIT
function abs() { var data = this._data; this._milliseconds = mathAbs(this._milliseconds); this._days = mathAbs(this._days); this._months = mathAbs(this._months); data.milliseconds = mathAbs(data.milliseconds); data.seconds = mathAbs(data.seconds); data.minutes =...
@param {Object} target @param {Object} [config] @returns {{url: string, description: string, live: boolean, abr: boolean, skip_ua: string[]}}
abs
javascript
gongfuxiang/shopxo
public/static/common/lib/ckplayer/hls.js/hls-demo.js
https://github.com/gongfuxiang/shopxo/blob/master/public/static/common/lib/ckplayer/hls.js/hls-demo.js
MIT
function addSubtract$1(duration, input, value, direction) { var other = createDuration(input, value); duration._milliseconds += direction * other._milliseconds; duration._days += direction * other._days; duration._months += direction * other._months; return duration._bubble(); ...
@param {Object} target @param {Object} [config] @returns {{url: string, description: string, live: boolean, abr: boolean, skip_ua: string[]}}
addSubtract$1
javascript
gongfuxiang/shopxo
public/static/common/lib/ckplayer/hls.js/hls-demo.js
https://github.com/gongfuxiang/shopxo/blob/master/public/static/common/lib/ckplayer/hls.js/hls-demo.js
MIT
function add$1(input, value) { return addSubtract$1(this, input, value, 1); }
@param {Object} target @param {Object} [config] @returns {{url: string, description: string, live: boolean, abr: boolean, skip_ua: string[]}}
add$1
javascript
gongfuxiang/shopxo
public/static/common/lib/ckplayer/hls.js/hls-demo.js
https://github.com/gongfuxiang/shopxo/blob/master/public/static/common/lib/ckplayer/hls.js/hls-demo.js
MIT
function subtract$1(input, value) { return addSubtract$1(this, input, value, -1); }
@param {Object} target @param {Object} [config] @returns {{url: string, description: string, live: boolean, abr: boolean, skip_ua: string[]}}
subtract$1
javascript
gongfuxiang/shopxo
public/static/common/lib/ckplayer/hls.js/hls-demo.js
https://github.com/gongfuxiang/shopxo/blob/master/public/static/common/lib/ckplayer/hls.js/hls-demo.js
MIT
function absCeil(number) { if (number < 0) { return Math.floor(number); } else { return Math.ceil(number); } }
@param {Object} target @param {Object} [config] @returns {{url: string, description: string, live: boolean, abr: boolean, skip_ua: string[]}}
absCeil
javascript
gongfuxiang/shopxo
public/static/common/lib/ckplayer/hls.js/hls-demo.js
https://github.com/gongfuxiang/shopxo/blob/master/public/static/common/lib/ckplayer/hls.js/hls-demo.js
MIT
function bubble() { var milliseconds = this._milliseconds, days = this._days, months = this._months, data = this._data, seconds, minutes, hours, years, monthsFromDays; // if we have a mix of positive and neg...
@param {Object} target @param {Object} [config] @returns {{url: string, description: string, live: boolean, abr: boolean, skip_ua: string[]}}
bubble
javascript
gongfuxiang/shopxo
public/static/common/lib/ckplayer/hls.js/hls-demo.js
https://github.com/gongfuxiang/shopxo/blob/master/public/static/common/lib/ckplayer/hls.js/hls-demo.js
MIT
function EE(fn, context, once) { this.fn = fn; this.context = context; this.once = once || false; }
Representation of a single event listener. @param {Function} fn The listener function. @param {*} context The context to invoke the listener with. @param {Boolean} [once=false] Specify if the listener is a one-time listener. @constructor @private
EE
javascript
gongfuxiang/shopxo
public/static/common/lib/ckplayer/hls.js/hls.js
https://github.com/gongfuxiang/shopxo/blob/master/public/static/common/lib/ckplayer/hls.js/hls.js
MIT
function CMCDController(hls) { var _this = this; this.hls = void 0; this.config = void 0; this.media = void 0; this.sid = void 0; this.cid = void 0; this.useHeaders = false; this.initialized = false; this.starved = false; this.buffering = true; this.audioBuffer = void 0; ...
Controller to deal with Common Media Client Data (CMCD) @see https://cdn.cta.tech/cta/media/media/resources/standards/pdfs/cta-5004-final.pdf
CMCDController
javascript
gongfuxiang/shopxo
public/static/common/lib/ckplayer/hls.js/hls.js
https://github.com/gongfuxiang/shopxo/blob/master/public/static/common/lib/ckplayer/hls.js/hls.js
MIT
isValid = function isValid(value) { return !Number.isNaN(value) && value != null && value !== '' && value !== false; }
Serialize a CMCD data object according to the rules defined in the section 3.2 of [CTA-5004](https://cdn.cta.tech/cta/media/media/resources/standards/pdfs/cta-5004-final.pdf).
isValid
javascript
gongfuxiang/shopxo
public/static/common/lib/ckplayer/hls.js/hls.js
https://github.com/gongfuxiang/shopxo/blob/master/public/static/common/lib/ckplayer/hls.js/hls.js
MIT
toRounded = function toRounded(value) { return Math.round(value); }
Serialize a CMCD data object according to the rules defined in the section 3.2 of [CTA-5004](https://cdn.cta.tech/cta/media/media/resources/standards/pdfs/cta-5004-final.pdf).
toRounded
javascript
gongfuxiang/shopxo
public/static/common/lib/ckplayer/hls.js/hls.js
https://github.com/gongfuxiang/shopxo/blob/master/public/static/common/lib/ckplayer/hls.js/hls.js
MIT
toHundred = function toHundred(value) { return toRounded(value / 100) * 100; }
Serialize a CMCD data object according to the rules defined in the section 3.2 of [CTA-5004](https://cdn.cta.tech/cta/media/media/resources/standards/pdfs/cta-5004-final.pdf).
toHundred
javascript
gongfuxiang/shopxo
public/static/common/lib/ckplayer/hls.js/hls.js
https://github.com/gongfuxiang/shopxo/blob/master/public/static/common/lib/ckplayer/hls.js/hls.js
MIT
toUrlSafe = function toUrlSafe(value) { return encodeURIComponent(value); }
Serialize a CMCD data object according to the rules defined in the section 3.2 of [CTA-5004](https://cdn.cta.tech/cta/media/media/resources/standards/pdfs/cta-5004-final.pdf).
toUrlSafe
javascript
gongfuxiang/shopxo
public/static/common/lib/ckplayer/hls.js/hls.js
https://github.com/gongfuxiang/shopxo/blob/master/public/static/common/lib/ckplayer/hls.js/hls.js
MIT
getSupportedMediaKeySystemConfigurations = function getSupportedMediaKeySystemConfigurations(keySystem, audioCodecs, videoCodecs, drmSystemOptions) { switch (keySystem) { case _utils_mediakeys_helper__WEBPACK_IMPORTED_MODULE_3__["KeySystems"].WIDEVINE: return createWidevineMediaKeySystemConfigurations(audio...
The idea here is to handle key-system (and their respective platforms) specific configuration differences in order to work with the local requestMediaKeySystemAccess method. We can also rule-out platform-related key-system support at this point by throwing an error. @param {string} keySystem Identifier for the key-sy...
getSupportedMediaKeySystemConfigurations
javascript
gongfuxiang/shopxo
public/static/common/lib/ckplayer/hls.js/hls.js
https://github.com/gongfuxiang/shopxo/blob/master/public/static/common/lib/ckplayer/hls.js/hls.js
MIT
function EMEController(hls) { this.hls = void 0; this._widevineLicenseUrl = void 0; this._licenseXhrSetup = void 0; this._licenseResponseCallback = void 0; this._emeEnabled = void 0; this._requestMediaKeySystemAccess = void 0; this._drmSystemOptions = void 0; this._config = void 0; t...
@constructs @param {Hls} hls Our Hls.js instance
EMEController
javascript
gongfuxiang/shopxo
public/static/common/lib/ckplayer/hls.js/hls.js
https://github.com/gongfuxiang/shopxo/blob/master/public/static/common/lib/ckplayer/hls.js/hls.js
MIT
function findFragmentByPDT(fragments, PDTValue, maxFragLookUpTolerance) { if (PDTValue === null || !Array.isArray(fragments) || !fragments.length || !Object(_home_runner_work_hls_js_hls_js_src_polyfills_number__WEBPACK_IMPORTED_MODULE_0__["isFiniteNumber"])(PDTValue)) { return null; } // if less than start ...
Returns first fragment whose endPdt value exceeds the given PDT. @param {Array<Fragment>} fragments - The array of candidate fragments @param {number|null} [PDTValue = null] - The PDT value which must be exceeded @param {number} [maxFragLookUpTolerance = 0] - The amount of time that a fragment's start/end can be within...
findFragmentByPDT
javascript
gongfuxiang/shopxo
public/static/common/lib/ckplayer/hls.js/hls.js
https://github.com/gongfuxiang/shopxo/blob/master/public/static/common/lib/ckplayer/hls.js/hls.js
MIT
function findFragmentByPTS(fragPrevious, fragments, bufferEnd, maxFragLookUpTolerance) { if (bufferEnd === void 0) { bufferEnd = 0; } if (maxFragLookUpTolerance === void 0) { maxFragLookUpTolerance = 0; } var fragNext = null; if (fragPrevious) { fragNext = fragments[fragPrevious.sn - fragment...
Finds a fragment based on the SN of the previous fragment; or based on the needs of the current buffer. This method compensates for small buffer gaps by applying a tolerance to the start of any candidate fragment, thus breaking any traps which would cause the same fragment to be continuously selected within a small ran...
findFragmentByPTS
javascript
gongfuxiang/shopxo
public/static/common/lib/ckplayer/hls.js/hls.js
https://github.com/gongfuxiang/shopxo/blob/master/public/static/common/lib/ckplayer/hls.js/hls.js
MIT
function pdtWithinToleranceTest(pdtBufferEnd, maxFragLookUpTolerance, candidate) { var candidateLookupTolerance = Math.min(maxFragLookUpTolerance, candidate.duration + (candidate.deltaPTS ? candidate.deltaPTS : 0)) * 1000; // endProgramDateTime can be null, default to zero var endProgramDateTime = candidate.endPro...
The test function used by the findFragmentByPdt's BinarySearch to look for the best match to the current buffer conditions. This function tests the candidate's program date time values, as represented in Unix time @param {*} candidate - The fragment to test @param {number} [pdtBufferEnd = 0] - The Unix time representin...
pdtWithinToleranceTest
javascript
gongfuxiang/shopxo
public/static/common/lib/ckplayer/hls.js/hls.js
https://github.com/gongfuxiang/shopxo/blob/master/public/static/common/lib/ckplayer/hls.js/hls.js
MIT
function findFragWithCC(fragments, cc) { return _utils_binary_search__WEBPACK_IMPORTED_MODULE_1__["default"].search(fragments, function (candidate) { if (candidate.cc < cc) { return 1; } else if (candidate.cc > cc) { return -1; } else { return 0; } }); }
The test function used by the findFragmentByPdt's BinarySearch to look for the best match to the current buffer conditions. This function tests the candidate's program date time values, as represented in Unix time @param {*} candidate - The fragment to test @param {number} [pdtBufferEnd = 0] - The Unix time representin...
findFragWithCC
javascript
gongfuxiang/shopxo
public/static/common/lib/ckplayer/hls.js/hls.js
https://github.com/gongfuxiang/shopxo/blob/master/public/static/common/lib/ckplayer/hls.js/hls.js
MIT
function isPartial(fragmentEntity) { var _fragmentEntity$range, _fragmentEntity$range2; return fragmentEntity.buffered && (((_fragmentEntity$range = fragmentEntity.range.video) === null || _fragmentEntity$range === void 0 ? void 0 : _fragmentEntity$range.partial) || ((_fragmentEntity$range2 = fragmentEntity.range....
Gets the partial fragment for a certain time
isPartial
javascript
gongfuxiang/shopxo
public/static/common/lib/ckplayer/hls.js/hls.js
https://github.com/gongfuxiang/shopxo/blob/master/public/static/common/lib/ckplayer/hls.js/hls.js
MIT
function getFragmentKey(fragment) { return fragment.type + "_" + fragment.level + "_" + fragment.urlId + "_" + fragment.sn; }
Gets the partial fragment for a certain time
getFragmentKey
javascript
gongfuxiang/shopxo
public/static/common/lib/ckplayer/hls.js/hls.js
https://github.com/gongfuxiang/shopxo/blob/master/public/static/common/lib/ckplayer/hls.js/hls.js
MIT
filterLevelAndGroupByIdIndex = function filterLevelAndGroupByIdIndex(url, id) { return id !== urlId; }
Switch to a redundant stream if any available. If redundant stream is not available, emergency switch down if ABR mode is enabled.
filterLevelAndGroupByIdIndex
javascript
gongfuxiang/shopxo
public/static/common/lib/ckplayer/hls.js/hls.js
https://github.com/gongfuxiang/shopxo/blob/master/public/static/common/lib/ckplayer/hls.js/hls.js
MIT
function addGroupId(level, type, id) { switch (type) { case 'audio': if (!level.audioGroupIds) { level.audioGroupIds = []; } level.audioGroupIds.push(id); break; case 'text': if (!level.textGroupIds) { level.textGroupIds = []; } level.textGroupIds.p...
@module LevelHelper Providing methods dealing with playlist sliding and drift
addGroupId
javascript
gongfuxiang/shopxo
public/static/common/lib/ckplayer/hls.js/hls.js
https://github.com/gongfuxiang/shopxo/blob/master/public/static/common/lib/ckplayer/hls.js/hls.js
MIT
function assignTrackIdsByGroup(tracks) { var groups = {}; tracks.forEach(function (track) { var groupId = track.groupId || ''; track.id = groups[groupId] = groups[groupId] || 0; groups[groupId]++; }); }
@module LevelHelper Providing methods dealing with playlist sliding and drift
assignTrackIdsByGroup
javascript
gongfuxiang/shopxo
public/static/common/lib/ckplayer/hls.js/hls.js
https://github.com/gongfuxiang/shopxo/blob/master/public/static/common/lib/ckplayer/hls.js/hls.js
MIT
function updatePTS(fragments, fromIdx, toIdx) { var fragFrom = fragments[fromIdx]; var fragTo = fragments[toIdx]; updateFromToPTS(fragFrom, fragTo); }
@module LevelHelper Providing methods dealing with playlist sliding and drift
updatePTS
javascript
gongfuxiang/shopxo
public/static/common/lib/ckplayer/hls.js/hls.js
https://github.com/gongfuxiang/shopxo/blob/master/public/static/common/lib/ckplayer/hls.js/hls.js
MIT
function updateFromToPTS(fragFrom, fragTo) { var fragToPTS = fragTo.startPTS; // if we know startPTS[toIdx] if (Object(_home_runner_work_hls_js_hls_js_src_polyfills_number__WEBPACK_IMPORTED_MODULE_0__["isFiniteNumber"])(fragToPTS)) { // update fragment duration. // it helps to fix drifts between playlist r...
@module LevelHelper Providing methods dealing with playlist sliding and drift
updateFromToPTS
javascript
gongfuxiang/shopxo
public/static/common/lib/ckplayer/hls.js/hls.js
https://github.com/gongfuxiang/shopxo/blob/master/public/static/common/lib/ckplayer/hls.js/hls.js
MIT
function updateFragPTSDTS(details, frag, startPTS, endPTS, startDTS, endDTS) { var parsedMediaDuration = endPTS - startPTS; if (parsedMediaDuration <= 0) { _utils_logger__WEBPACK_IMPORTED_MODULE_1__["logger"].warn('Fragment should have a positive duration', frag); endPTS = startPTS + frag.duration; end...
@module LevelHelper Providing methods dealing with playlist sliding and drift
updateFragPTSDTS
javascript
gongfuxiang/shopxo
public/static/common/lib/ckplayer/hls.js/hls.js
https://github.com/gongfuxiang/shopxo/blob/master/public/static/common/lib/ckplayer/hls.js/hls.js
MIT
function mergeDetails(oldDetails, newDetails) { // Track the last initSegment processed. Initialize it to the last one on the timeline. var currentInitSegment = null; var oldFragments = oldDetails.fragments; for (var i = oldFragments.length - 1; i >= 0; i--) { var oldInit = oldFragments[i].initSegment; ...
@module LevelHelper Providing methods dealing with playlist sliding and drift
mergeDetails
javascript
gongfuxiang/shopxo
public/static/common/lib/ckplayer/hls.js/hls.js
https://github.com/gongfuxiang/shopxo/blob/master/public/static/common/lib/ckplayer/hls.js/hls.js
MIT
function mapPartIntersection(oldParts, newParts, intersectionFn) { if (oldParts && newParts) { var delta = 0; for (var i = 0, len = oldParts.length; i <= len; i++) { var _oldPart = oldParts[i]; var _newPart = newParts[i + delta]; if (_oldPart && _newPart && _oldPart.index === _newPart.inde...
@module LevelHelper Providing methods dealing with playlist sliding and drift
mapPartIntersection
javascript
gongfuxiang/shopxo
public/static/common/lib/ckplayer/hls.js/hls.js
https://github.com/gongfuxiang/shopxo/blob/master/public/static/common/lib/ckplayer/hls.js/hls.js
MIT
function mapFragmentIntersection(oldDetails, newDetails, intersectionFn) { var skippedSegments = newDetails.skippedSegments; var start = Math.max(oldDetails.startSN, newDetails.startSN) - newDetails.startSN; var end = (oldDetails.fragmentHint ? 1 : 0) + (skippedSegments ? newDetails.endSN : Math.min(oldDetails.en...
@module LevelHelper Providing methods dealing with playlist sliding and drift
mapFragmentIntersection
javascript
gongfuxiang/shopxo
public/static/common/lib/ckplayer/hls.js/hls.js
https://github.com/gongfuxiang/shopxo/blob/master/public/static/common/lib/ckplayer/hls.js/hls.js
MIT
function adjustSliding(oldDetails, newDetails) { var delta = newDetails.startSN + newDetails.skippedSegments - oldDetails.startSN; var oldFragments = oldDetails.fragments; if (delta < 0 || delta >= oldFragments.length) { return; } addSliding(newDetails, oldFragments[delta].start); }
@module LevelHelper Providing methods dealing with playlist sliding and drift
adjustSliding
javascript
gongfuxiang/shopxo
public/static/common/lib/ckplayer/hls.js/hls.js
https://github.com/gongfuxiang/shopxo/blob/master/public/static/common/lib/ckplayer/hls.js/hls.js
MIT
function addSliding(details, start) { if (start) { var fragments = details.fragments; for (var i = details.skippedSegments; i < fragments.length; i++) { fragments[i].start += start; } if (details.fragmentHint) { details.fragmentHint.start += start; } } }
@module LevelHelper Providing methods dealing with playlist sliding and drift
addSliding
javascript
gongfuxiang/shopxo
public/static/common/lib/ckplayer/hls.js/hls.js
https://github.com/gongfuxiang/shopxo/blob/master/public/static/common/lib/ckplayer/hls.js/hls.js
MIT
function computeReloadInterval(newDetails, stats) { var reloadInterval = 1000 * newDetails.levelTargetDuration; var reloadIntervalAfterMiss = reloadInterval / 2; var timeSinceLastModified = newDetails.age; var useLastModified = timeSinceLastModified > 0 && timeSinceLastModified < reloadInterval * 3; var round...
@module LevelHelper Providing methods dealing with playlist sliding and drift
computeReloadInterval
javascript
gongfuxiang/shopxo
public/static/common/lib/ckplayer/hls.js/hls.js
https://github.com/gongfuxiang/shopxo/blob/master/public/static/common/lib/ckplayer/hls.js/hls.js
MIT
function getFragmentWithSN(level, sn, fragCurrent) { if (!level || !level.details) { return null; } var levelDetails = level.details; var fragment = levelDetails.fragments[sn - levelDetails.startSN]; if (fragment) { return fragment; } fragment = levelDetails.fragmentHint; if (fragment && fra...
@module LevelHelper Providing methods dealing with playlist sliding and drift
getFragmentWithSN
javascript
gongfuxiang/shopxo
public/static/common/lib/ckplayer/hls.js/hls.js
https://github.com/gongfuxiang/shopxo/blob/master/public/static/common/lib/ckplayer/hls.js/hls.js
MIT
function getPartWith(level, sn, partIndex) { if (!level || !level.details) { return null; } var partList = level.details.partList; if (partList) { for (var i = partList.length; i--;) { var part = partList[i]; if (part.index === partIndex && part.fragment.sn === sn) { return part; ...
@module LevelHelper Providing methods dealing with playlist sliding and drift
getPartWith
javascript
gongfuxiang/shopxo
public/static/common/lib/ckplayer/hls.js/hls.js
https://github.com/gongfuxiang/shopxo/blob/master/public/static/common/lib/ckplayer/hls.js/hls.js
MIT
function filterSubtitleTracks(textTrackList) { var tracks = []; for (var i = 0; i < textTrackList.length; i++) { var track = textTrackList[i]; // Edge adds a track without a label; we don't want to use it if (track.kind === 'subtitles' && track.label) { tracks.push(textTrackList[i]); } } re...
get/set index of the selected subtitle track (based on index in subtitle track lists) *
filterSubtitleTracks
javascript
gongfuxiang/shopxo
public/static/common/lib/ckplayer/hls.js/hls.js
https://github.com/gongfuxiang/shopxo/blob/master/public/static/common/lib/ckplayer/hls.js/hls.js
MIT
function isHeaderPattern(data, offset) { return data[offset] === 0xff && (data[offset + 1] & 0xf6) === 0xf0; }
ADTS parser helper @link https://wiki.multimedia.cx/index.php?title=ADTS
isHeaderPattern
javascript
gongfuxiang/shopxo
public/static/common/lib/ckplayer/hls.js/hls.js
https://github.com/gongfuxiang/shopxo/blob/master/public/static/common/lib/ckplayer/hls.js/hls.js
MIT
function getHeaderLength(data, offset) { return data[offset + 1] & 0x01 ? 7 : 9; }
ADTS parser helper @link https://wiki.multimedia.cx/index.php?title=ADTS
getHeaderLength
javascript
gongfuxiang/shopxo
public/static/common/lib/ckplayer/hls.js/hls.js
https://github.com/gongfuxiang/shopxo/blob/master/public/static/common/lib/ckplayer/hls.js/hls.js
MIT
function getFullFrameLength(data, offset) { return (data[offset + 3] & 0x03) << 11 | data[offset + 4] << 3 | (data[offset + 5] & 0xe0) >>> 5; }
ADTS parser helper @link https://wiki.multimedia.cx/index.php?title=ADTS
getFullFrameLength
javascript
gongfuxiang/shopxo
public/static/common/lib/ckplayer/hls.js/hls.js
https://github.com/gongfuxiang/shopxo/blob/master/public/static/common/lib/ckplayer/hls.js/hls.js
MIT
function canGetFrameLength(data, offset) { return offset + 5 < data.length; }
ADTS parser helper @link https://wiki.multimedia.cx/index.php?title=ADTS
canGetFrameLength
javascript
gongfuxiang/shopxo
public/static/common/lib/ckplayer/hls.js/hls.js
https://github.com/gongfuxiang/shopxo/blob/master/public/static/common/lib/ckplayer/hls.js/hls.js
MIT
function isHeader(data, offset) { // Look for ADTS header | 1111 1111 | 1111 X00X | where X can be either 0 or 1 // Layer bits (position 14 and 15) in header should be always 0 for ADTS // More info https://wiki.multimedia.cx/index.php?title=ADTS return offset + 1 < data.length && isHeaderPattern(data, offset);...
ADTS parser helper @link https://wiki.multimedia.cx/index.php?title=ADTS
isHeader
javascript
gongfuxiang/shopxo
public/static/common/lib/ckplayer/hls.js/hls.js
https://github.com/gongfuxiang/shopxo/blob/master/public/static/common/lib/ckplayer/hls.js/hls.js
MIT
function canParse(data, offset) { return canGetFrameLength(data, offset) && isHeaderPattern(data, offset) && getFullFrameLength(data, offset) <= data.length - offset; }
ADTS parser helper @link https://wiki.multimedia.cx/index.php?title=ADTS
canParse
javascript
gongfuxiang/shopxo
public/static/common/lib/ckplayer/hls.js/hls.js
https://github.com/gongfuxiang/shopxo/blob/master/public/static/common/lib/ckplayer/hls.js/hls.js
MIT
function probe(data, offset) { // same as isHeader but we also check that ADTS frame follows last ADTS frame // or end of data is reached if (isHeader(data, offset)) { // ADTS header Length var headerLength = getHeaderLength(data, offset); if (offset + headerLength >= data.length) { return fals...
ADTS parser helper @link https://wiki.multimedia.cx/index.php?title=ADTS
probe
javascript
gongfuxiang/shopxo
public/static/common/lib/ckplayer/hls.js/hls.js
https://github.com/gongfuxiang/shopxo/blob/master/public/static/common/lib/ckplayer/hls.js/hls.js
MIT
function initTrackConfig(track, observer, data, offset, audioCodec) { if (!track.samplerate) { var config = getAudioConfig(observer, data, offset, audioCodec); if (!config) { return; } track.config = config.config; track.samplerate = config.samplerate; track.channelCount = config.chann...
ADTS parser helper @link https://wiki.multimedia.cx/index.php?title=ADTS
initTrackConfig
javascript
gongfuxiang/shopxo
public/static/common/lib/ckplayer/hls.js/hls.js
https://github.com/gongfuxiang/shopxo/blob/master/public/static/common/lib/ckplayer/hls.js/hls.js
MIT
function getFrameDuration(samplerate) { return 1024 * 90000 / samplerate; }
ADTS parser helper @link https://wiki.multimedia.cx/index.php?title=ADTS
getFrameDuration
javascript
gongfuxiang/shopxo
public/static/common/lib/ckplayer/hls.js/hls.js
https://github.com/gongfuxiang/shopxo/blob/master/public/static/common/lib/ckplayer/hls.js/hls.js
MIT
function parseFrameHeader(data, offset, pts, frameIndex, frameDuration) { // The protection skip bit tells us if we have 2 bytes of CRC data at the end of the ADTS header var headerLength = getHeaderLength(data, offset); // retrieve frame size var frameLength = getFullFrameLength(data, offset); frameLength -= ...
ADTS parser helper @link https://wiki.multimedia.cx/index.php?title=ADTS
parseFrameHeader
javascript
gongfuxiang/shopxo
public/static/common/lib/ckplayer/hls.js/hls.js
https://github.com/gongfuxiang/shopxo/blob/master/public/static/common/lib/ckplayer/hls.js/hls.js
MIT
function appendFrame(track, data, offset, pts, frameIndex) { var frameDuration = getFrameDuration(track.samplerate); var header = parseFrameHeader(data, offset, pts, frameIndex, frameDuration); if (header) { var frameLength = header.frameLength, headerLength = header.headerLength, stamp = hea...
ADTS parser helper @link https://wiki.multimedia.cx/index.php?title=ADTS
appendFrame
javascript
gongfuxiang/shopxo
public/static/common/lib/ckplayer/hls.js/hls.js
https://github.com/gongfuxiang/shopxo/blob/master/public/static/common/lib/ckplayer/hls.js/hls.js
MIT
initPTSFn = function initPTSFn(timestamp, timeOffset) { return Object(_home_runner_work_hls_js_hls_js_src_polyfills_number__WEBPACK_IMPORTED_MODULE_0__["isFiniteNumber"])(timestamp) ? timestamp * 90 : timeOffset * 90000; }
Initialize PTS <p> use timestamp unless it is undefined, NaN or Infinity </p>
initPTSFn
javascript
gongfuxiang/shopxo
public/static/common/lib/ckplayer/hls.js/hls.js
https://github.com/gongfuxiang/shopxo/blob/master/public/static/common/lib/ckplayer/hls.js/hls.js
MIT
function ExpGolomb(data) { this.data = void 0; this.bytesAvailable = void 0; this.word = void 0; this.bitsAvailable = void 0; this.data = data; // the number of bytes left to examine in this.data this.bytesAvailable = data.byteLength; // the current word being examined this.word = 0; // :u...
Parser for exponential Golomb codes, a variable-bitwidth number encoding scheme used by h264.
ExpGolomb
javascript
gongfuxiang/shopxo
public/static/common/lib/ckplayer/hls.js/hls.js
https://github.com/gongfuxiang/shopxo/blob/master/public/static/common/lib/ckplayer/hls.js/hls.js
MIT
isHeader = function isHeader(data, offset) { /* * http://id3.org/id3v2.3.0 * [0] = 'I' * [1] = 'D' * [2] = '3' * [3,4] = {Version} * [5] = {Flags} * [6-9] = {ID3 Size} * * An ID3v2 tag can be detected with the following pattern: * $49 44 33 yy yy xx zz zz zz zz * ...
Returns true if an ID3 header can be found at offset in data @param {Uint8Array} data - The data to search in @param {number} offset - The offset at which to start searching @return {boolean} - True if an ID3 header is found
isHeader
javascript
gongfuxiang/shopxo
public/static/common/lib/ckplayer/hls.js/hls.js
https://github.com/gongfuxiang/shopxo/blob/master/public/static/common/lib/ckplayer/hls.js/hls.js
MIT
isFooter = function isFooter(data, offset) { /* * The footer is a copy of the header, but with a different identifier */ if (offset + 10 <= data.length) { // look for '3DI' identifier if (data[offset] === 0x33 && data[offset + 1] === 0x44 && data[offset + 2] === 0x49) { // check version is withi...
Returns true if an ID3 footer can be found at offset in data @param {Uint8Array} data - The data to search in @param {number} offset - The offset at which to start searching @return {boolean} - True if an ID3 footer is found
isFooter
javascript
gongfuxiang/shopxo
public/static/common/lib/ckplayer/hls.js/hls.js
https://github.com/gongfuxiang/shopxo/blob/master/public/static/common/lib/ckplayer/hls.js/hls.js
MIT
getID3Data = function getID3Data(data, offset) { var front = offset; var length = 0; while (isHeader(data, offset)) { // ID3 header is 10 bytes length += 10; var size = readSize(data, offset + 6); length += size; if (isFooter(data, offset + 10)) { // ID3 footer is 10 bytes length...
Returns any adjacent ID3 tags found in data starting at offset, as one block of data @param {Uint8Array} data - The data to search in @param {number} offset - The offset at which to start searching @return {Uint8Array | undefined} - The block of data containing any ID3 tags found or *undefined* if no header is found at...
getID3Data
javascript
gongfuxiang/shopxo
public/static/common/lib/ckplayer/hls.js/hls.js
https://github.com/gongfuxiang/shopxo/blob/master/public/static/common/lib/ckplayer/hls.js/hls.js
MIT
readSize = function readSize(data, offset) { var size = 0; size = (data[offset] & 0x7f) << 21; size |= (data[offset + 1] & 0x7f) << 14; size |= (data[offset + 2] & 0x7f) << 7; size |= data[offset + 3] & 0x7f; return size; }
Returns any adjacent ID3 tags found in data starting at offset, as one block of data @param {Uint8Array} data - The data to search in @param {number} offset - The offset at which to start searching @return {Uint8Array | undefined} - The block of data containing any ID3 tags found or *undefined* if no header is found at...
readSize
javascript
gongfuxiang/shopxo
public/static/common/lib/ckplayer/hls.js/hls.js
https://github.com/gongfuxiang/shopxo/blob/master/public/static/common/lib/ckplayer/hls.js/hls.js
MIT
canParse = function canParse(data, offset) { return isHeader(data, offset) && readSize(data, offset + 6) + 10 <= data.length - offset; }
Returns any adjacent ID3 tags found in data starting at offset, as one block of data @param {Uint8Array} data - The data to search in @param {number} offset - The offset at which to start searching @return {Uint8Array | undefined} - The block of data containing any ID3 tags found or *undefined* if no header is found at...
canParse
javascript
gongfuxiang/shopxo
public/static/common/lib/ckplayer/hls.js/hls.js
https://github.com/gongfuxiang/shopxo/blob/master/public/static/common/lib/ckplayer/hls.js/hls.js
MIT
getTimeStamp = function getTimeStamp(data) { var frames = getID3Frames(data); for (var i = 0; i < frames.length; i++) { var frame = frames[i]; if (isTimeStampFrame(frame)) { return readTimeStamp(frame); } } return undefined; }
Searches for the Elementary Stream timestamp found in the ID3 data chunk @param {Uint8Array} data - Block of data containing one or more ID3 tags @return {number | undefined} - The timestamp
getTimeStamp
javascript
gongfuxiang/shopxo
public/static/common/lib/ckplayer/hls.js/hls.js
https://github.com/gongfuxiang/shopxo/blob/master/public/static/common/lib/ckplayer/hls.js/hls.js
MIT
isTimeStampFrame = function isTimeStampFrame(frame) { return frame && frame.key === 'PRIV' && frame.info === 'com.apple.streaming.transportStreamTimestamp'; }
Returns true if the ID3 frame is an Elementary Stream timestamp frame @param {ID3 frame} frame
isTimeStampFrame
javascript
gongfuxiang/shopxo
public/static/common/lib/ckplayer/hls.js/hls.js
https://github.com/gongfuxiang/shopxo/blob/master/public/static/common/lib/ckplayer/hls.js/hls.js
MIT
getFrameData = function getFrameData(data) { /* Frame ID $xx xx xx xx (four characters) Size $xx xx xx xx Flags $xx xx */ var type = String.fromCharCode(data[0], data[1], data[2], data[3]); var size = readSize(data, 4); // skip frame id, size, and flags var offset = 10; retur...
Returns true if the ID3 frame is an Elementary Stream timestamp frame @param {ID3 frame} frame
getFrameData
javascript
gongfuxiang/shopxo
public/static/common/lib/ckplayer/hls.js/hls.js
https://github.com/gongfuxiang/shopxo/blob/master/public/static/common/lib/ckplayer/hls.js/hls.js
MIT
getID3Frames = function getID3Frames(id3Data) { var offset = 0; var frames = []; while (isHeader(id3Data, offset)) { var size = readSize(id3Data, offset + 6); // skip past ID3 header offset += 10; var end = offset + size; // loop through frames in the ID3 tag while (offset + 8 < end) { va...
Returns an array of ID3 frames found in all the ID3 tags in the id3Data @param {Uint8Array} id3Data - The ID3 data containing one or more ID3 tags @return {ID3.Frame[]} - Array of ID3 frame objects
getID3Frames
javascript
gongfuxiang/shopxo
public/static/common/lib/ckplayer/hls.js/hls.js
https://github.com/gongfuxiang/shopxo/blob/master/public/static/common/lib/ckplayer/hls.js/hls.js
MIT
decodeFrame = function decodeFrame(frame) { if (frame.type === 'PRIV') { return decodePrivFrame(frame); } else if (frame.type[0] === 'W') { return decodeURLFrame(frame); } return decodeTextFrame(frame); }
Returns an array of ID3 frames found in all the ID3 tags in the id3Data @param {Uint8Array} id3Data - The ID3 data containing one or more ID3 tags @return {ID3.Frame[]} - Array of ID3 frame objects
decodeFrame
javascript
gongfuxiang/shopxo
public/static/common/lib/ckplayer/hls.js/hls.js
https://github.com/gongfuxiang/shopxo/blob/master/public/static/common/lib/ckplayer/hls.js/hls.js
MIT
decodePrivFrame = function decodePrivFrame(frame) { /* Format: <text string>\0<binary data> */ if (frame.size < 2) { return undefined; } var owner = utf8ArrayToStr(frame.data, true); var privateData = new Uint8Array(frame.data.subarray(owner.length + 1)); return { key: frame.type, info: own...
Returns an array of ID3 frames found in all the ID3 tags in the id3Data @param {Uint8Array} id3Data - The ID3 data containing one or more ID3 tags @return {ID3.Frame[]} - Array of ID3 frame objects
decodePrivFrame
javascript
gongfuxiang/shopxo
public/static/common/lib/ckplayer/hls.js/hls.js
https://github.com/gongfuxiang/shopxo/blob/master/public/static/common/lib/ckplayer/hls.js/hls.js
MIT
decodeTextFrame = function decodeTextFrame(frame) { if (frame.size < 2) { return undefined; } if (frame.type === 'TXXX') { /* Format: [0] = {Text Encoding} [1-?] = {Description}\0{Value} */ var index = 1; var description = utf8ArrayToStr(frame.data.subarray(index), true); in...
Returns an array of ID3 frames found in all the ID3 tags in the id3Data @param {Uint8Array} id3Data - The ID3 data containing one or more ID3 tags @return {ID3.Frame[]} - Array of ID3 frame objects
decodeTextFrame
javascript
gongfuxiang/shopxo
public/static/common/lib/ckplayer/hls.js/hls.js
https://github.com/gongfuxiang/shopxo/blob/master/public/static/common/lib/ckplayer/hls.js/hls.js
MIT
decodeURLFrame = function decodeURLFrame(frame) { if (frame.type === 'WXXX') { /* Format: [0] = {Text Encoding} [1-?] = {Description}\0{URL} */ if (frame.size < 2) { return undefined; } var index = 1; var description = utf8ArrayToStr(frame.data.subarray(index), true); ...
Returns an array of ID3 frames found in all the ID3 tags in the id3Data @param {Uint8Array} id3Data - The ID3 data containing one or more ID3 tags @return {ID3.Frame[]} - Array of ID3 frame objects
decodeURLFrame
javascript
gongfuxiang/shopxo
public/static/common/lib/ckplayer/hls.js/hls.js
https://github.com/gongfuxiang/shopxo/blob/master/public/static/common/lib/ckplayer/hls.js/hls.js
MIT
readTimeStamp = function readTimeStamp(timeStampFrame) { if (timeStampFrame.data.byteLength === 8) { var data = new Uint8Array(timeStampFrame.data); // timestamp is 33 bit expressed as a big-endian eight-octet number, // with the upper 31 bits set to zero. var pts33Bit = data[3] & 0x1; var timestamp ...
Returns an array of ID3 frames found in all the ID3 tags in the id3Data @param {Uint8Array} id3Data - The ID3 data containing one or more ID3 tags @return {ID3.Frame[]} - Array of ID3 frame objects
readTimeStamp
javascript
gongfuxiang/shopxo
public/static/common/lib/ckplayer/hls.js/hls.js
https://github.com/gongfuxiang/shopxo/blob/master/public/static/common/lib/ckplayer/hls.js/hls.js
MIT