@reactoo/watchtogether-sdk-js 2.6.67 → 2.6.69
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/watchtogether-sdk.js +6 -6
- package/dist/watchtogether-sdk.min.js +2 -2
- package/example/bulk_join_room/bulk_join_room.html +30 -30
- package/example/bulk_join_room/bulk_join_room_2.css +6 -1
- package/example/bulk_join_room/bulk_join_room_2.html +304 -137
- package/example/bulk_join_room/sound_empty.mp3 +0 -0
- package/example/index.html +26 -14
- package/package.json +1 -1
- package/src/models/room-session.js +12 -5
- package/src/models/room.js +1 -0
- package/src/modules/wt-room.js +504 -51
- package/src/modules/wt-utils.js +29 -1
- /package/example/bulk_join_room/{persons_gifs → persons_gifs_lq}/1.gif +0 -0
- /package/example/bulk_join_room/{persons_gifs → persons_gifs_lq}/10.gif +0 -0
- /package/example/bulk_join_room/{persons_gifs → persons_gifs_lq}/11.gif +0 -0
- /package/example/bulk_join_room/{persons_gifs → persons_gifs_lq}/12.gif +0 -0
- /package/example/bulk_join_room/{persons_gifs → persons_gifs_lq}/13.gif +0 -0
- /package/example/bulk_join_room/{persons_gifs → persons_gifs_lq}/14.gif +0 -0
- /package/example/bulk_join_room/{persons_gifs → persons_gifs_lq}/15.gif +0 -0
- /package/example/bulk_join_room/{persons_gifs → persons_gifs_lq}/16.gif +0 -0
- /package/example/bulk_join_room/{persons_gifs → persons_gifs_lq}/17.gif +0 -0
- /package/example/bulk_join_room/{persons_gifs → persons_gifs_lq}/18.gif +0 -0
- /package/example/bulk_join_room/{persons_gifs → persons_gifs_lq}/19.gif +0 -0
- /package/example/bulk_join_room/{persons_gifs → persons_gifs_lq}/2.gif +0 -0
- /package/example/bulk_join_room/{persons_gifs → persons_gifs_lq}/20.gif +0 -0
- /package/example/bulk_join_room/{persons_gifs → persons_gifs_lq}/21.gif +0 -0
- /package/example/bulk_join_room/{persons_gifs → persons_gifs_lq}/22.gif +0 -0
- /package/example/bulk_join_room/{persons_gifs → persons_gifs_lq}/23.gif +0 -0
- /package/example/bulk_join_room/{persons_gifs → persons_gifs_lq}/24.gif +0 -0
- /package/example/bulk_join_room/{persons_gifs → persons_gifs_lq}/25.gif +0 -0
- /package/example/bulk_join_room/{persons_gifs → persons_gifs_lq}/26.gif +0 -0
- /package/example/bulk_join_room/{persons_gifs → persons_gifs_lq}/27.gif +0 -0
- /package/example/bulk_join_room/{persons_gifs → persons_gifs_lq}/28.gif +0 -0
- /package/example/bulk_join_room/{persons_gifs → persons_gifs_lq}/29.gif +0 -0
- /package/example/bulk_join_room/{persons_gifs → persons_gifs_lq}/3.gif +0 -0
- /package/example/bulk_join_room/{persons_gifs → persons_gifs_lq}/30.gif +0 -0
- /package/example/bulk_join_room/{persons_gifs → persons_gifs_lq}/31.gif +0 -0
- /package/example/bulk_join_room/{persons_gifs → persons_gifs_lq}/32.gif +0 -0
- /package/example/bulk_join_room/{persons_gifs → persons_gifs_lq}/4.gif +0 -0
- /package/example/bulk_join_room/{persons_gifs → persons_gifs_lq}/5.gif +0 -0
- /package/example/bulk_join_room/{persons_gifs → persons_gifs_lq}/6.gif +0 -0
- /package/example/bulk_join_room/{persons_gifs → persons_gifs_lq}/7.gif +0 -0
- /package/example/bulk_join_room/{persons_gifs → persons_gifs_lq}/8.gif +0 -0
- /package/example/bulk_join_room/{persons_gifs → persons_gifs_lq}/9.gif +0 -0
package/src/modules/wt-utils.js
CHANGED
|
@@ -4,6 +4,22 @@ import {getFingerPrint} from "./wt-fingerprint";
|
|
|
4
4
|
|
|
5
5
|
let wait = function(ms) { return new Promise(resolve => setTimeout(resolve, ms))};
|
|
6
6
|
|
|
7
|
+
let median = function(values) {
|
|
8
|
+
|
|
9
|
+
if(values.length ===0) return 0;
|
|
10
|
+
|
|
11
|
+
values.sort(function(a,b){
|
|
12
|
+
return a-b;
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
var half = Math.floor(values.length / 2);
|
|
16
|
+
|
|
17
|
+
if (values.length % 2)
|
|
18
|
+
return values[half];
|
|
19
|
+
|
|
20
|
+
return (values[half - 1] + values[half]) / 2.0;
|
|
21
|
+
}
|
|
22
|
+
|
|
7
23
|
|
|
8
24
|
// const getFingerPrint = function(instanceType, salt) {
|
|
9
25
|
//
|
|
@@ -101,5 +117,17 @@ const clearExactTimeout = function(timeout) {
|
|
|
101
117
|
};
|
|
102
118
|
|
|
103
119
|
|
|
120
|
+
const maxJitter = (x) => {
|
|
121
|
+
// A function that returns a value between 0.3 and 0.5 depending on the input x
|
|
122
|
+
// The function is based on a logistic curve with parameters a, b, c, and d
|
|
123
|
+
// The parameters are chosen such that f(30) = 0.3 and f(2) = 0.5
|
|
124
|
+
let a = 0.2; // The maximum value of the function
|
|
125
|
+
let b = -0.1; // The growth rate of the function
|
|
126
|
+
let c = 16; // The inflection point of the function
|
|
127
|
+
let d = 0.3; // The minimum value of the function
|
|
128
|
+
return a / (1 + Math.exp(-b * (x - c))) + d; // Fixed the typo here
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
|
|
104
132
|
|
|
105
|
-
export {wait, getBrowserFingerprint, generateUUID, decodeJanusDisplay, setExactTimeout, clearExactTimeout}
|
|
133
|
+
export {wait, getBrowserFingerprint, generateUUID, decodeJanusDisplay, setExactTimeout, clearExactTimeout, median, maxJitter}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|