videomail-client 8.2.2 → 8.3.1
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/package.json +1 -2
- package/prototype/bad_browser.html +1 -1
- package/prototype/bad_ios.html +1 -1
- package/prototype/contact_form.html +1 -1
- package/prototype/correct_existing_videomail.html +1 -1
- package/prototype/correct_non_existing_videomail.html +1 -1
- package/prototype/direct_submit.html +1 -1
- package/prototype/entertain.html +1 -1
- package/prototype/experimental_audio.html +1 -1
- package/prototype/facing_mode_button.html +1 -1
- package/prototype/form_without_email.html +1 -1
- package/prototype/high_quality.html +3 -3
- package/prototype/invalid_site_name.html +1 -1
- package/prototype/js/videomail-client.js +6 -4
- package/prototype/js/videomail-client.min.js +1 -1
- package/prototype/js/videomail-client.min.js.map +1 -1
- package/prototype/player_only.html +1 -1
- package/prototype/predefined.html +1 -1
- package/prototype/simple.html +1 -1
- package/prototype/simple_jpegs.html +1 -1
- package/prototype/user_media_on_record.html +1 -1
- package/prototype/videomail_optional_form.html +1 -1
- package/prototype/with_cc_and_bcc.html +1 -1
- package/src/js/index.js +4 -3
- package/videomail-client.code-workspace +25 -0
- package/.eslintignore +0 -1
- package/.eslintrc.js +0 -46
- package/.nvmrc +0 -1
- package/.prettierignore +0 -1
- package/.travis.yml +0 -14
- package/audit-ci.json +0 -12
- package/babel.config.js +0 -38
- package/browserstack.png +0 -0
- package/env/dev/cert.pem +0 -26
- package/env/dev/key.pem +0 -28
- package/env/dev/release.sh +0 -96
- package/gulpfile.js +0 -241
- package/prettier.config.js +0 -8
- package/test/core/client.test.js +0 -64
- package/test/core/resource.test.js +0 -12
- package/test/util/audioRecorder.test.js +0 -13
- package/test/util/browser.test.js +0 -157
- package/test/util/collectLogger.test.js +0 -13
- package/test/util/eventEmitter.test.js +0 -13
- package/test/util/humanize.test.js +0 -21
- package/test/util/pretty.test.js +0 -116
- package/test/util/videomailError.test.js +0 -323
- package/test/wrappers/buttons.test.js +0 -15
- package/test/wrappers/container.test.js +0 -18
- package/test/wrappers/form.test.js +0 -13
- package/test/wrappers/notifier.test.js +0 -13
- package/test/wrappers/recorder.test.js +0 -18
- package/test/wrappers/replay.test.js +0 -15
- package/test/wrappers/userMedia.test.js +0 -13
- package/test/wrappers/visuals.test.js +0 -18
|
@@ -1,323 +0,0 @@
|
|
|
1
|
-
import VideomailError from "./../../src/js/util/videomailError";
|
|
2
|
-
import test from "tape-catch";
|
|
3
|
-
|
|
4
|
-
const fakeOptions = {
|
|
5
|
-
debug() {},
|
|
6
|
-
};
|
|
7
|
-
|
|
8
|
-
test("Videomail Error:", function (t) {
|
|
9
|
-
t.test("arguments", function (tt) {
|
|
10
|
-
tt.test("no arguments", function (tt) {
|
|
11
|
-
tt.plan(5);
|
|
12
|
-
|
|
13
|
-
const err = new VideomailError();
|
|
14
|
-
|
|
15
|
-
tt.ok(err instanceof VideomailError);
|
|
16
|
-
tt.ok(err instanceof Error);
|
|
17
|
-
|
|
18
|
-
tt.equal(err.toString(), "Videomail Error");
|
|
19
|
-
tt.equal(err.message, "");
|
|
20
|
-
tt.equal(err.explanation, undefined);
|
|
21
|
-
});
|
|
22
|
-
|
|
23
|
-
tt.test("all undefined", function (tt) {
|
|
24
|
-
tt.plan(3);
|
|
25
|
-
|
|
26
|
-
const err = new VideomailError(
|
|
27
|
-
undefined,
|
|
28
|
-
{
|
|
29
|
-
explanation: undefined,
|
|
30
|
-
},
|
|
31
|
-
fakeOptions,
|
|
32
|
-
);
|
|
33
|
-
|
|
34
|
-
tt.equal(err.toString(), "Videomail Error");
|
|
35
|
-
tt.equal(err.message, "");
|
|
36
|
-
tt.equal(err.explanation, undefined);
|
|
37
|
-
});
|
|
38
|
-
|
|
39
|
-
tt.test("one message", function (tt) {
|
|
40
|
-
tt.plan(3);
|
|
41
|
-
|
|
42
|
-
const err = new VideomailError("one message", fakeOptions);
|
|
43
|
-
|
|
44
|
-
tt.equal(err.toString(), "Videomail Error: one message");
|
|
45
|
-
tt.equal(err.message, "one message");
|
|
46
|
-
tt.equal(err.explanation, undefined);
|
|
47
|
-
});
|
|
48
|
-
|
|
49
|
-
tt.test("and an explanation", function (tt) {
|
|
50
|
-
tt.plan(3);
|
|
51
|
-
|
|
52
|
-
const err = new VideomailError(
|
|
53
|
-
"one message",
|
|
54
|
-
{
|
|
55
|
-
explanation: "and an explanation",
|
|
56
|
-
},
|
|
57
|
-
fakeOptions,
|
|
58
|
-
);
|
|
59
|
-
|
|
60
|
-
tt.equal(err.toString(), "Videomail Error: one message");
|
|
61
|
-
tt.equal(err.message, "one message");
|
|
62
|
-
tt.equal(err.explanation, "and an explanation");
|
|
63
|
-
});
|
|
64
|
-
});
|
|
65
|
-
|
|
66
|
-
t.test("static create(err)", function (tt) {
|
|
67
|
-
tt.test("null", function (tt) {
|
|
68
|
-
tt.plan(3);
|
|
69
|
-
|
|
70
|
-
const err = VideomailError.create(undefined, undefined, {
|
|
71
|
-
debug() {}, // so that it wont pollute output during tests
|
|
72
|
-
});
|
|
73
|
-
|
|
74
|
-
tt.equal(err.toString(), "Videomail Error");
|
|
75
|
-
tt.equal(err.message, "");
|
|
76
|
-
tt.equal(err.explanation, undefined);
|
|
77
|
-
});
|
|
78
|
-
|
|
79
|
-
tt.test("no arguments", function (tt) {
|
|
80
|
-
tt.plan(3);
|
|
81
|
-
|
|
82
|
-
const err = VideomailError.create(new Error(), fakeOptions);
|
|
83
|
-
|
|
84
|
-
tt.equal(err.toString(), "Videomail Error: Error");
|
|
85
|
-
tt.equal(err.message, "Error");
|
|
86
|
-
tt.equal(err.explanation, undefined);
|
|
87
|
-
});
|
|
88
|
-
|
|
89
|
-
tt.test("undefined message", function (tt) {
|
|
90
|
-
tt.plan(3);
|
|
91
|
-
|
|
92
|
-
const err = VideomailError.create(new Error(undefined), fakeOptions);
|
|
93
|
-
|
|
94
|
-
tt.equal(err.toString(), "Videomail Error: Error");
|
|
95
|
-
tt.equal(err.message, "Error");
|
|
96
|
-
tt.equal(err.explanation, undefined);
|
|
97
|
-
});
|
|
98
|
-
|
|
99
|
-
tt.test("bad integer", function (tt) {
|
|
100
|
-
tt.plan(3);
|
|
101
|
-
|
|
102
|
-
const err = VideomailError.create(123, fakeOptions);
|
|
103
|
-
|
|
104
|
-
tt.equal(err.toString(), "Videomail Error: 123");
|
|
105
|
-
tt.equal(err.message, "123");
|
|
106
|
-
tt.equal(err.explanation, undefined);
|
|
107
|
-
});
|
|
108
|
-
|
|
109
|
-
tt.test("one message", function (tt) {
|
|
110
|
-
tt.plan(3);
|
|
111
|
-
|
|
112
|
-
const err = VideomailError.create("one message", fakeOptions);
|
|
113
|
-
|
|
114
|
-
tt.equal(err.toString(), "Videomail Error: one message");
|
|
115
|
-
tt.equal(err.message, "one message");
|
|
116
|
-
tt.equal(err.explanation, undefined);
|
|
117
|
-
});
|
|
118
|
-
|
|
119
|
-
tt.test("deals with VideomailError instance", function (tt) {
|
|
120
|
-
tt.plan(3);
|
|
121
|
-
|
|
122
|
-
const err = VideomailError.create(
|
|
123
|
-
new VideomailError("i am already instantiated", fakeOptions),
|
|
124
|
-
);
|
|
125
|
-
|
|
126
|
-
tt.equal(err.toString(), "Videomail Error: i am already instantiated");
|
|
127
|
-
tt.equal(err.message, "i am already instantiated");
|
|
128
|
-
tt.equal(err.explanation, undefined);
|
|
129
|
-
});
|
|
130
|
-
|
|
131
|
-
tt.test("PERMISSION_DENIED", function (tt) {
|
|
132
|
-
tt.plan(6);
|
|
133
|
-
|
|
134
|
-
const err1 = VideomailError.create(
|
|
135
|
-
{
|
|
136
|
-
code: 1,
|
|
137
|
-
PERMISSION_DENIED: 1,
|
|
138
|
-
},
|
|
139
|
-
fakeOptions,
|
|
140
|
-
);
|
|
141
|
-
|
|
142
|
-
tt.equal(err1.toString(), "Videomail Error: Permission denied");
|
|
143
|
-
tt.equal(err1.message, "Permission denied");
|
|
144
|
-
tt.equal(
|
|
145
|
-
err1.explanation,
|
|
146
|
-
"Cannot access your webcam. This can have two reasons:<br/>a) you blocked access to webcam; or<br/>b) your webcam is already in use.",
|
|
147
|
-
);
|
|
148
|
-
|
|
149
|
-
const err2 = VideomailError.create(
|
|
150
|
-
{
|
|
151
|
-
code: 2,
|
|
152
|
-
PERMISSION_DENIED: 2,
|
|
153
|
-
},
|
|
154
|
-
fakeOptions,
|
|
155
|
-
);
|
|
156
|
-
|
|
157
|
-
tt.equal(err2.toString(), "Videomail Error");
|
|
158
|
-
tt.equal(err2.message, "");
|
|
159
|
-
tt.equal(err2.explanation, "- 2<br/>- 2");
|
|
160
|
-
});
|
|
161
|
-
|
|
162
|
-
tt.test("NOT_ALLOWED_ERROR", function (tt) {
|
|
163
|
-
tt.plan(3);
|
|
164
|
-
|
|
165
|
-
const err1 = VideomailError.create(VideomailError.NOT_ALLOWED_ERROR, fakeOptions);
|
|
166
|
-
|
|
167
|
-
tt.equal(err1.toString(), "Videomail Error: Permission denied");
|
|
168
|
-
tt.equal(err1.message, "Permission denied");
|
|
169
|
-
tt.equal(
|
|
170
|
-
err1.explanation,
|
|
171
|
-
"Cannot access your webcam. This can have two reasons:<br/>a) you blocked access to webcam; or<br/>b) your webcam is already in use.",
|
|
172
|
-
);
|
|
173
|
-
});
|
|
174
|
-
|
|
175
|
-
tt.test("with bad name in object", function (tt) {
|
|
176
|
-
tt.plan(3);
|
|
177
|
-
|
|
178
|
-
const err = VideomailError.create(
|
|
179
|
-
{
|
|
180
|
-
name: 1,
|
|
181
|
-
},
|
|
182
|
-
fakeOptions,
|
|
183
|
-
);
|
|
184
|
-
|
|
185
|
-
tt.equal(err.toString(), "Videomail Error: 1");
|
|
186
|
-
tt.equal(err.message, "1");
|
|
187
|
-
tt.equal(err.explanation, undefined);
|
|
188
|
-
});
|
|
189
|
-
|
|
190
|
-
tt.test("with NO_DEVICES_FOUND as name in object", function (tt) {
|
|
191
|
-
tt.plan(3);
|
|
192
|
-
|
|
193
|
-
const err = VideomailError.create(
|
|
194
|
-
{
|
|
195
|
-
name: "NO_DEVICES_FOUND",
|
|
196
|
-
},
|
|
197
|
-
fakeOptions,
|
|
198
|
-
);
|
|
199
|
-
|
|
200
|
-
tt.equal(err.toString(), "Videomail Error: No webcam found");
|
|
201
|
-
tt.equal(err.message, "No webcam found");
|
|
202
|
-
tt.equal(
|
|
203
|
-
err.explanation,
|
|
204
|
-
"Your browser cannot find a webcam attached to your machine.",
|
|
205
|
-
);
|
|
206
|
-
});
|
|
207
|
-
|
|
208
|
-
tt.test("with PermissionDeniedError as name in object", function (tt) {
|
|
209
|
-
tt.plan(3);
|
|
210
|
-
|
|
211
|
-
const err = VideomailError.create(
|
|
212
|
-
{
|
|
213
|
-
name: "PermissionDeniedError",
|
|
214
|
-
},
|
|
215
|
-
fakeOptions,
|
|
216
|
-
);
|
|
217
|
-
|
|
218
|
-
tt.equal(err.toString(), "Videomail Error: Permission denied");
|
|
219
|
-
tt.equal(err.message, "Permission denied");
|
|
220
|
-
tt.equal(
|
|
221
|
-
err.explanation,
|
|
222
|
-
"Cannot access your webcam. This can have two reasons:<br/>a) you blocked access to webcam; or<br/>b) your webcam is already in use.",
|
|
223
|
-
);
|
|
224
|
-
});
|
|
225
|
-
|
|
226
|
-
tt.test("with HARDWARE_UNAVAILABLE as name in object", function (tt) {
|
|
227
|
-
tt.plan(3);
|
|
228
|
-
|
|
229
|
-
const err = VideomailError.create(
|
|
230
|
-
{
|
|
231
|
-
name: "HARDWARE_UNAVAILABLE",
|
|
232
|
-
},
|
|
233
|
-
fakeOptions,
|
|
234
|
-
);
|
|
235
|
-
|
|
236
|
-
tt.equal(err.toString(), "Videomail Error: Webcam is unavailable");
|
|
237
|
-
tt.equal(err.message, "Webcam is unavailable");
|
|
238
|
-
tt.equal(err.explanation, "Maybe it is already busy in another window?");
|
|
239
|
-
});
|
|
240
|
-
|
|
241
|
-
tt.test('with "Not connected" as name in object', function (tt) {
|
|
242
|
-
tt.plan(3);
|
|
243
|
-
|
|
244
|
-
const err = VideomailError.create(
|
|
245
|
-
{
|
|
246
|
-
name: "Not connected",
|
|
247
|
-
},
|
|
248
|
-
fakeOptions,
|
|
249
|
-
);
|
|
250
|
-
|
|
251
|
-
tt.equal(err.toString(), "Videomail Error: Unable to connect");
|
|
252
|
-
tt.equal(err.message, "Unable to connect");
|
|
253
|
-
tt.equal(
|
|
254
|
-
err.explanation,
|
|
255
|
-
"Either the videomail server or your connection is down. Trying to reconnect every few seconds …",
|
|
256
|
-
);
|
|
257
|
-
});
|
|
258
|
-
|
|
259
|
-
tt.test('with "Not connected" as argument', function (tt) {
|
|
260
|
-
tt.plan(3);
|
|
261
|
-
|
|
262
|
-
const err = VideomailError.create("Not connected", fakeOptions);
|
|
263
|
-
|
|
264
|
-
tt.equal(err.toString(), "Videomail Error: Unable to connect");
|
|
265
|
-
tt.equal(err.message, "Unable to connect");
|
|
266
|
-
tt.equal(
|
|
267
|
-
err.explanation,
|
|
268
|
-
"Either the videomail server or your connection is down. Trying to reconnect every few seconds …",
|
|
269
|
-
);
|
|
270
|
-
});
|
|
271
|
-
|
|
272
|
-
tt.test("with NO_VIDEO_FEED as name in object", function (tt) {
|
|
273
|
-
tt.plan(3);
|
|
274
|
-
|
|
275
|
-
const err = VideomailError.create(
|
|
276
|
-
{
|
|
277
|
-
name: "NO_VIDEO_FEED",
|
|
278
|
-
},
|
|
279
|
-
fakeOptions,
|
|
280
|
-
);
|
|
281
|
-
|
|
282
|
-
tt.equal(err.toString(), "Videomail Error: No video feed found!");
|
|
283
|
-
tt.equal(err.message, "No video feed found!");
|
|
284
|
-
tt.equal(err.explanation, "Your webcam is already used in another browser.");
|
|
285
|
-
});
|
|
286
|
-
|
|
287
|
-
tt.test('with "Starting video failed" as name in object', function (tt) {
|
|
288
|
-
tt.plan(3);
|
|
289
|
-
|
|
290
|
-
const err = VideomailError.create(
|
|
291
|
-
{
|
|
292
|
-
name: "Starting video failed",
|
|
293
|
-
},
|
|
294
|
-
fakeOptions,
|
|
295
|
-
);
|
|
296
|
-
|
|
297
|
-
tt.equal(err.toString(), "Videomail Error: Starting video failed");
|
|
298
|
-
tt.equal(err.message, "Starting video failed");
|
|
299
|
-
tt.equal(
|
|
300
|
-
err.explanation,
|
|
301
|
-
"Most likely this happens when the webcam is already active in another browser.",
|
|
302
|
-
);
|
|
303
|
-
});
|
|
304
|
-
|
|
305
|
-
tt.test("with DevicesNotFoundError as name in object", function (tt) {
|
|
306
|
-
tt.plan(3);
|
|
307
|
-
|
|
308
|
-
const err = VideomailError.create(
|
|
309
|
-
{
|
|
310
|
-
name: "DevicesNotFoundError",
|
|
311
|
-
},
|
|
312
|
-
fakeOptions,
|
|
313
|
-
);
|
|
314
|
-
|
|
315
|
-
tt.equal(err.toString(), "Videomail Error: No available webcam could be found");
|
|
316
|
-
tt.equal(err.message, "No available webcam could be found");
|
|
317
|
-
tt.equal(
|
|
318
|
-
err.explanation,
|
|
319
|
-
"Looks like you do not have any webcam attached to your machine; or the one you plugged in is already used.",
|
|
320
|
-
);
|
|
321
|
-
});
|
|
322
|
-
});
|
|
323
|
-
});
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import test from "tape-catch";
|
|
2
|
-
|
|
3
|
-
import Buttons from "./../../src/js/wrappers/buttons";
|
|
4
|
-
|
|
5
|
-
test("Buttons:", function (t) {
|
|
6
|
-
t.test("can be instantiated", function (tt) {
|
|
7
|
-
tt.plan(1);
|
|
8
|
-
|
|
9
|
-
tt.doesNotThrow(function () {
|
|
10
|
-
return new Buttons(null, {
|
|
11
|
-
debug() {},
|
|
12
|
-
});
|
|
13
|
-
});
|
|
14
|
-
});
|
|
15
|
-
});
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import test from "tape-catch";
|
|
2
|
-
|
|
3
|
-
import Container from "./../../src/js/wrappers/container";
|
|
4
|
-
|
|
5
|
-
test("Container:", function (t) {
|
|
6
|
-
t.test("can be instantiated", function (tt) {
|
|
7
|
-
tt.plan(1);
|
|
8
|
-
|
|
9
|
-
tt.doesNotThrow(function () {
|
|
10
|
-
return new Container({
|
|
11
|
-
video: {
|
|
12
|
-
fps: 15,
|
|
13
|
-
},
|
|
14
|
-
image: {},
|
|
15
|
-
});
|
|
16
|
-
});
|
|
17
|
-
});
|
|
18
|
-
});
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import test from "tape-catch";
|
|
2
|
-
|
|
3
|
-
import Form from "./../../src/js/wrappers/form";
|
|
4
|
-
|
|
5
|
-
test("Form:", function (t) {
|
|
6
|
-
t.test("can be instantiated", function (tt) {
|
|
7
|
-
tt.plan(1);
|
|
8
|
-
|
|
9
|
-
tt.doesNotThrow(function () {
|
|
10
|
-
return new Form();
|
|
11
|
-
});
|
|
12
|
-
});
|
|
13
|
-
});
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import test from "tape-catch";
|
|
2
|
-
|
|
3
|
-
import Notifier from "./../../src/js/wrappers/visuals/notifier";
|
|
4
|
-
|
|
5
|
-
test("Notifier:", function (t) {
|
|
6
|
-
t.test("can be instantiated", function (tt) {
|
|
7
|
-
tt.plan(1);
|
|
8
|
-
|
|
9
|
-
tt.doesNotThrow(function () {
|
|
10
|
-
return new Notifier();
|
|
11
|
-
});
|
|
12
|
-
});
|
|
13
|
-
});
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import test from "tape-catch";
|
|
2
|
-
|
|
3
|
-
import Recorder from "./../../src/js/wrappers/visuals/recorder";
|
|
4
|
-
|
|
5
|
-
test("Recorder:", function (t) {
|
|
6
|
-
t.test("can be instantiated", function (tt) {
|
|
7
|
-
tt.plan(1);
|
|
8
|
-
|
|
9
|
-
tt.doesNotThrow(function () {
|
|
10
|
-
return new Recorder(null, null, {
|
|
11
|
-
video: {
|
|
12
|
-
fps: 15,
|
|
13
|
-
},
|
|
14
|
-
image: {},
|
|
15
|
-
});
|
|
16
|
-
});
|
|
17
|
-
});
|
|
18
|
-
});
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import test from "tape-catch";
|
|
2
|
-
|
|
3
|
-
import Replay from "./../../src/js/wrappers/visuals/replay";
|
|
4
|
-
|
|
5
|
-
test("Replay:", function (t) {
|
|
6
|
-
t.test("can be instantiated", function (tt) {
|
|
7
|
-
tt.plan(1);
|
|
8
|
-
|
|
9
|
-
tt.doesNotThrow(function () {
|
|
10
|
-
return new Replay(null, {
|
|
11
|
-
debug() {},
|
|
12
|
-
});
|
|
13
|
-
});
|
|
14
|
-
});
|
|
15
|
-
});
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import test from "tape-catch";
|
|
2
|
-
|
|
3
|
-
import UserMedia from "./../../src/js/wrappers/visuals/userMedia";
|
|
4
|
-
|
|
5
|
-
test("UserMedia:", function (t) {
|
|
6
|
-
t.test("can be instantiated", function (tt) {
|
|
7
|
-
tt.plan(1);
|
|
8
|
-
|
|
9
|
-
tt.doesNotThrow(function () {
|
|
10
|
-
return new UserMedia();
|
|
11
|
-
});
|
|
12
|
-
});
|
|
13
|
-
});
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import test from "tape-catch";
|
|
2
|
-
|
|
3
|
-
import Visuals from "./../../src/js/wrappers/visuals";
|
|
4
|
-
|
|
5
|
-
test("Visuals:", function (t) {
|
|
6
|
-
t.test("can be instantiated", function (tt) {
|
|
7
|
-
tt.plan(1);
|
|
8
|
-
|
|
9
|
-
tt.doesNotThrow(function () {
|
|
10
|
-
return new Visuals(null, {
|
|
11
|
-
video: {
|
|
12
|
-
fps: 15,
|
|
13
|
-
},
|
|
14
|
-
image: {},
|
|
15
|
-
});
|
|
16
|
-
});
|
|
17
|
-
});
|
|
18
|
-
});
|