-
Notifications
You must be signed in to change notification settings - Fork 217
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Merge Preflight and PlanB removal feature branch (#1702) * VIDEO-7728 | Better Preflight Errors (#1689) * Adding better errors on preflight * lint * Update docs * Changelog * Update docs * Convert error to string * Adding timestamp to progress events * Properly raising signaling errors * lint * Update tests * Mak's feedback * Update test * Feature/remove plan b (#1697) * VIDEO-6587 | Remove Plan B in SDK (#1656) * Initial implementation. * Fixing integration tests * Updating unit tests * Adding back unit test job * Removing unneeded case * Fix build * Adding rename suggestion Co-authored-by: Manjesh Malavalli <[email protected]> * Adding changelog * Update CHANGELOG.md Co-authored-by: Manjesh Malavalli <[email protected]> * Adding ticket number Co-authored-by: Manjesh Malavalli <[email protected]> Co-authored-by: Manjesh Malavalli <[email protected]> * Move changelog to 2.20.0 section * 2.20.0-rc1 * 2.20.0-dev Co-authored-by: Manjesh Malavalli <[email protected]> Co-authored-by: Manjesh Malavalli <[email protected]> Co-authored-by: twilio-ci <[email protected]> * Fix unit test from merge * 2.20.0-rc2 * 2.20.0-dev * Update doc * Update changelog Co-authored-by: Manjesh Malavalli <[email protected]> Co-authored-by: Manjesh Malavalli <[email protected]> Co-authored-by: twilio-ci <[email protected]> * Removing framework tests (#1700) * Convert createLocalTracks to TS (#1694) * VIDEO-7714 - Convert createLocalTracks to TypeScript Co-authored-by: joma <[email protected]> Co-authored-by: charliesantos <[email protected]> * Update @twilio/webrtc to 4.6.0-rc1 (#1705) * Update @twilio-webrtc to RC Co-authored-by: joma <[email protected]> * 2.21.0-rc1 * 2.21.0-dev * merge from master * VIDEO-8791 - Adding extra information into CHANGELOG (#1716) * Adding extra information into CHANGELOG * 2.21.0-rc2 * 2.21.0-dev * VIDEO-8647 - Fixing Chrome Docker Image (#1718) * VIDEO-8647 Fixing docker images build for Chrome * VIDEO-8954: Adding in extra links and details to the CHANGELOG entry (#1722) * VIDEO-8954 - Adding in extra links and details to the CHANGELOG entry * VIDEO-8647 - Fixing Chrome Docker Image (#1718) (#1721) (#1728) * VIDEO-8647 Fixing docker images build for Chrome * VIDEO-8939 - Migrating twilio/webrtc (#1731) * VIDEO-8939 - Folding twilio/webrtc into SDK, installing util and events packages. * Prep for 2.21.1 RC (#1739) * Adding CHANGELOG entry for 2.21.1 RC * 2.21.1-rc1 * 2.21.1-dev * Marking unstable integration tests (#1740) * Marking unstable integration tests * merge from master (#1745) * VIDEO-9511 - do not configure encodings for stopped tracks (#1768) * do not update encodings for stopped tracks * Emit dimensionsChanged event on videoTrack start * Add test for videoTrack _start method * Add changelog entry for VIDEO-3576 * VIDEO-9282 - Migrate SDK from using node.js util. (#1752) * VIDEO-9282 - Removing all references to node dependencies. Co-authored-by: Makarand Patwardhan <[email protected]> * 2.21.2-rc1 * 2.21.2-dev * VIDEO-8282 - Adding iPad Detection (#1779) * VIDEO-8282 - Adding iPad and iPhone detection logic * 2.21.2-rc2 * 2.21.2-dev * Prep for 2.21.2 release, updating changelog Co-authored-by: Charlemagne Santos <[email protected]> Co-authored-by: Manjesh Malavalli <[email protected]> Co-authored-by: Manjesh Malavalli <[email protected]> Co-authored-by: twilio-ci <[email protected]> Co-authored-by: Makarand Patwardhan <[email protected]> Co-authored-by: Tim Mendoza <[email protected]> Co-authored-by: timmydoza <[email protected]>
- Loading branch information
1 parent
352ebf3
commit ad2cede
Showing
31 changed files
with
688 additions
and
162 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
|
||
/** | ||
* Expose `Backoff`. | ||
*/ | ||
|
||
class Backoff { | ||
/** | ||
* Construct a {@link Backoff}. | ||
* @param {object} options | ||
* @property {number} min - Initial timeout in milliseconds [100] | ||
* @property {number} max - Max timeout [10000] | ||
* @property {boolean} jitter - Apply jitter [0] | ||
* @property {number} factor - Multiplication factor for Backoff operation [2] | ||
*/ | ||
constructor(options) { | ||
Object.defineProperties(this, { | ||
_min: { | ||
value: options.min || 100 | ||
}, | ||
_max: { | ||
value: options.max || 10000 | ||
}, | ||
_jitter: { | ||
value: options.jitter > 0 && options.jitter <= 1 ? options.jitter : 0 | ||
}, | ||
_factor: { | ||
value: options.factor || 2 | ||
}, | ||
_attempts: { | ||
value: 0, | ||
writable: true | ||
}, | ||
_duration: { | ||
enumerable: false, | ||
get() { | ||
let ms = this._min * Math.pow(this._factor, this._attempts); | ||
if (this._jitter) { | ||
const rand = Math.random(); | ||
const deviation = Math.floor(rand * this._jitter * ms); | ||
ms = (Math.floor(rand * 10) & 1) === 0 ? ms - deviation : ms + deviation; | ||
} | ||
return Math.min(ms, this._max) | 0; | ||
} | ||
}, | ||
_timeoutID: { | ||
value: null, | ||
writable: true | ||
} | ||
}); | ||
} | ||
|
||
/** | ||
* Start the backoff operation. | ||
* @param {function} fn - Function to call | ||
* @return {void} | ||
* @api public | ||
*/ | ||
backoff(fn) { | ||
let duration = this._duration; | ||
if (this._timeoutID) { | ||
clearTimeout(this._timeoutID); | ||
this._timeoutID = null; | ||
} | ||
this._timeoutID = setTimeout(() => { | ||
this._attempts++; | ||
fn(); | ||
}, duration); | ||
} | ||
|
||
/** | ||
* Reset the number of attempts and clear the timer. | ||
* | ||
* @return {void} | ||
* @api public | ||
*/ | ||
reset() { | ||
this._attempts = 0; | ||
if (this._timeoutID) { | ||
clearTimeout(this._timeoutID); | ||
this._timeoutID = null; | ||
} | ||
} | ||
} | ||
|
||
module.exports = Backoff; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
/** | ||
* Copyright (c) 2011-2022 Isaac Z. Schlueter | ||
* Licensed under the ISC License. | ||
* | ||
* Copied from https://github.com/isaacs/inherits (2.0.4) | ||
*/ | ||
|
||
module.exports = function inherits(ctor, superCtor) { | ||
if (ctor && superCtor) { | ||
ctor.super_ = superCtor; | ||
if (typeof Object.create === 'function') { | ||
// implementation from standard node.js 'util' module | ||
ctor.prototype = Object.create(superCtor.prototype, { | ||
constructor: { | ||
value: ctor, | ||
enumerable: false, | ||
writable: true, | ||
configurable: true | ||
} | ||
}); | ||
} else { | ||
// old school shim for old browsers | ||
class TempCtor { | ||
constructor() { } | ||
} | ||
TempCtor.prototype = superCtor.prototype; | ||
ctor.prototype = new TempCtor(); | ||
ctor.prototype.constructor = ctor; | ||
} | ||
} | ||
}; |
Oops, something went wrong.