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.
Files changed (55) hide show
  1. package/package.json +1 -2
  2. package/prototype/bad_browser.html +1 -1
  3. package/prototype/bad_ios.html +1 -1
  4. package/prototype/contact_form.html +1 -1
  5. package/prototype/correct_existing_videomail.html +1 -1
  6. package/prototype/correct_non_existing_videomail.html +1 -1
  7. package/prototype/direct_submit.html +1 -1
  8. package/prototype/entertain.html +1 -1
  9. package/prototype/experimental_audio.html +1 -1
  10. package/prototype/facing_mode_button.html +1 -1
  11. package/prototype/form_without_email.html +1 -1
  12. package/prototype/high_quality.html +3 -3
  13. package/prototype/invalid_site_name.html +1 -1
  14. package/prototype/js/videomail-client.js +6 -4
  15. package/prototype/js/videomail-client.min.js +1 -1
  16. package/prototype/js/videomail-client.min.js.map +1 -1
  17. package/prototype/player_only.html +1 -1
  18. package/prototype/predefined.html +1 -1
  19. package/prototype/simple.html +1 -1
  20. package/prototype/simple_jpegs.html +1 -1
  21. package/prototype/user_media_on_record.html +1 -1
  22. package/prototype/videomail_optional_form.html +1 -1
  23. package/prototype/with_cc_and_bcc.html +1 -1
  24. package/src/js/index.js +4 -3
  25. package/videomail-client.code-workspace +25 -0
  26. package/.eslintignore +0 -1
  27. package/.eslintrc.js +0 -46
  28. package/.nvmrc +0 -1
  29. package/.prettierignore +0 -1
  30. package/.travis.yml +0 -14
  31. package/audit-ci.json +0 -12
  32. package/babel.config.js +0 -38
  33. package/browserstack.png +0 -0
  34. package/env/dev/cert.pem +0 -26
  35. package/env/dev/key.pem +0 -28
  36. package/env/dev/release.sh +0 -96
  37. package/gulpfile.js +0 -241
  38. package/prettier.config.js +0 -8
  39. package/test/core/client.test.js +0 -64
  40. package/test/core/resource.test.js +0 -12
  41. package/test/util/audioRecorder.test.js +0 -13
  42. package/test/util/browser.test.js +0 -157
  43. package/test/util/collectLogger.test.js +0 -13
  44. package/test/util/eventEmitter.test.js +0 -13
  45. package/test/util/humanize.test.js +0 -21
  46. package/test/util/pretty.test.js +0 -116
  47. package/test/util/videomailError.test.js +0 -323
  48. package/test/wrappers/buttons.test.js +0 -15
  49. package/test/wrappers/container.test.js +0 -18
  50. package/test/wrappers/form.test.js +0 -13
  51. package/test/wrappers/notifier.test.js +0 -13
  52. package/test/wrappers/recorder.test.js +0 -18
  53. package/test/wrappers/replay.test.js +0 -15
  54. package/test/wrappers/userMedia.test.js +0 -13
  55. package/test/wrappers/visuals.test.js +0 -18
@@ -1,64 +0,0 @@
1
- import test from "tape-catch";
2
- import h from "hyperscript";
3
-
4
- import VideomailClient from "./../../src/js/client";
5
-
6
- const SILENT = true;
7
-
8
- function addDivForVideomail() {
9
- const body = document.getElementsByTagName("body")[0];
10
- const div = h("div#videomail");
11
-
12
- body.appendChild(div);
13
- }
14
-
15
- test("VideomailClient:", { timeout: 2000 }, function (t) {
16
- let client;
17
-
18
- addDivForVideomail();
19
-
20
- t.test("can be instantiated and emits built event", function (tt) {
21
- tt.plan(2);
22
-
23
- const consoleFacade = console;
24
-
25
- if (SILENT) {
26
- consoleFacade.error = function () {};
27
- consoleFacade.warn = function () {};
28
- consoleFacade.debug = function () {};
29
- }
30
-
31
- tt.doesNotThrow(function () {
32
- client = new VideomailClient({
33
- verbose: !SILENT,
34
- logger: consoleFacade,
35
- });
36
-
37
- client.once(client.events.BUILT, function () {
38
- tt.pass("Built event received");
39
- });
40
- });
41
- });
42
-
43
- // todo: add test for fn show() once tape-run + electronjs allow getUserMedia access
44
-
45
- t.test("hiding does not throw error and emits event", function (tt) {
46
- tt.plan(2);
47
-
48
- client.once(client.events.HIDE, function () {
49
- tt.pass("Hide event received");
50
- });
51
-
52
- tt.doesNotThrow(function () {
53
- client.hide();
54
- });
55
- });
56
-
57
- t.test("unload does not throw an error and emits event", function (tt) {
58
- tt.plan(1);
59
-
60
- tt.doesNotThrow(function () {
61
- client.unload();
62
- });
63
- });
64
- });
@@ -1,12 +0,0 @@
1
- import test from "tape-catch";
2
- import Resource from "./../../src/js/resource";
3
-
4
- test("Resource:", function (t) {
5
- t.test("can be instantiated", function (tt) {
6
- tt.plan(1);
7
-
8
- tt.doesNotThrow(function () {
9
- return new Resource();
10
- });
11
- });
12
- });
@@ -1,13 +0,0 @@
1
- import test from "tape-catch";
2
-
3
- import AudioRecorder from "./../../src/js/util/audioRecorder";
4
-
5
- test("AudioRecorder:", function (t) {
6
- t.test("can be instantiated", function (tt) {
7
- tt.plan(1);
8
-
9
- tt.doesNotThrow(function () {
10
- return new AudioRecorder();
11
- });
12
- });
13
- });
@@ -1,157 +0,0 @@
1
- import test from "tape-catch";
2
-
3
- import Browser from "../../src/js/util/browser";
4
-
5
- test("Browser:", { timeout: 2000 }, function (t) {
6
- t.test("without arguments", function (tt) {
7
- tt.plan(7);
8
-
9
- const browser = new Browser({ debug() {} });
10
-
11
- let err = browser.checkBufferTypes();
12
- tt.equal(err, undefined);
13
-
14
- const videoType = browser.getVideoType();
15
- tt.equal(videoType, "mp4");
16
-
17
- err = browser.getNoAccessIssue();
18
- tt.equal(err.message, "Unable to access webcam");
19
- tt.equal(
20
- err.explanation,
21
- "Your system does not let your browser access your webcam.",
22
- );
23
-
24
- tt.equal(browser.isChromeBased(), false);
25
- tt.equal(browser.isFirefox(), false);
26
- tt.equal(browser.isEdge(), false);
27
- });
28
-
29
- t.test("fake old Firefox", function (tt) {
30
- tt.plan(7);
31
-
32
- const options = {
33
- fakeUaString:
34
- "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:23.0) Gecko/20131011 Firefox/23.0",
35
- debug() {},
36
- };
37
-
38
- const browser = new Browser(options);
39
- let err = browser.checkBufferTypes();
40
- tt.equal(err, undefined);
41
-
42
- tt.equal(browser.getVideoType(), "mp4");
43
-
44
- err = browser.getNoAccessIssue();
45
- tt.equal(err.message, "Unable to access webcam");
46
- tt.equal(err.explanation, "Please grant Firefox access to your webcam.");
47
-
48
- tt.equal(browser.isChromeBased(), false);
49
- tt.equal(browser.isFirefox(), true);
50
- tt.equal(browser.isEdge(), false);
51
- });
52
-
53
- t.test("fake old Chrome", function (tt) {
54
- tt.plan(7);
55
-
56
- const options = {
57
- fakeUaString:
58
- "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/535.8 (KHTML, like Gecko) Chrome/17.0.940.0 Safari/535.8",
59
- debug() {},
60
- };
61
-
62
- const browser = new Browser(options);
63
- let err = browser.checkBufferTypes();
64
- tt.equal(err, undefined);
65
-
66
- tt.equal(browser.getVideoType(), "mp4");
67
-
68
- err = browser.getNoAccessIssue();
69
- tt.equal(err.message, "Unable to access webcam");
70
- tt.equal(
71
- err.explanation,
72
- "Click on the allow button to grant access to your webcam.",
73
- );
74
-
75
- tt.equal(browser.isChromeBased(), true);
76
- tt.equal(browser.isFirefox(), false);
77
- tt.equal(browser.isEdge(), false);
78
- });
79
-
80
- t.test("fake old IE", function (tt) {
81
- tt.plan(9);
82
-
83
- const options = {
84
- fakeUaString:
85
- "Mozilla/5.0 (compatible; MSIE 8.0; Windows NT 5.2; Trident/4.0; Media Center PC 4.0; SLCC1; .NET CLR 3.0.04320)",
86
- fakeHttps: true,
87
- debug() {},
88
- };
89
-
90
- const browser = new Browser(options);
91
- let err = browser.checkRecordingCapabilities();
92
- tt.equal(err.message, "Sorry, your browser is unable to use webcams");
93
- tt.ok(
94
- err.explanation.indexOf("Instead of Internet Explorer you need to upgrade") >= 0,
95
- );
96
-
97
- err = browser.checkBufferTypes();
98
- tt.equal(err, undefined);
99
-
100
- tt.equal(browser.getVideoType(), "mp4");
101
-
102
- err = browser.getNoAccessIssue();
103
- tt.equal(err.message, "Unable to access webcam");
104
- tt.equal(
105
- err.explanation,
106
- "Your system does not let your browser access your webcam.",
107
- );
108
-
109
- tt.equal(browser.isChromeBased(), false);
110
- tt.equal(browser.isFirefox(), false);
111
- tt.equal(browser.isEdge(), false);
112
- });
113
-
114
- t.test("fake old Safari", function (tt) {
115
- tt.plan(7);
116
-
117
- const options = {
118
- fakeUaString:
119
- "Mozilla/5.0 (Macintosh; U; PPC Mac OS X 10_5_8; en-us) AppleWebKit/532.0+ (KHTML, like Gecko) Version/4.0.3 Safari/531.9",
120
- fakeHttps: true,
121
- debug() {},
122
- };
123
-
124
- const browser = new Browser(options);
125
- let err = browser.checkBufferTypes();
126
- tt.equal(err, undefined);
127
-
128
- tt.equal(browser.getVideoType(), "mp4");
129
-
130
- err = browser.getNoAccessIssue();
131
- tt.equal(err.message, "Unable to access webcam");
132
- tt.equal(
133
- err.explanation,
134
- "Your system does not let your browser access your webcam.",
135
- );
136
-
137
- tt.equal(browser.isChromeBased(), false);
138
- tt.equal(browser.isFirefox(), false);
139
- tt.equal(browser.isEdge(), false);
140
- });
141
-
142
- t.test("is edge", function (tt) {
143
- tt.plan(3);
144
-
145
- const options = {
146
- fakeUaString:
147
- "Mozilla/5.0 (Windows NT 10.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.135 Safari/537.36 Edge/12.10136",
148
- debug() {},
149
- };
150
-
151
- const browser = new Browser(options);
152
-
153
- tt.equal(browser.isChromeBased(), false);
154
- tt.equal(browser.isFirefox(), false);
155
- tt.equal(browser.isEdge(), true);
156
- });
157
- });
@@ -1,13 +0,0 @@
1
- import test from "tape-catch";
2
-
3
- import CollectLogger from "./../../src/js/util/collectLogger";
4
-
5
- test("CollectLogger:", function (t) {
6
- t.test("can be instantiated", function (tt) {
7
- tt.plan(1);
8
-
9
- tt.doesNotThrow(function () {
10
- return new CollectLogger();
11
- });
12
- });
13
- });
@@ -1,13 +0,0 @@
1
- import test from "tape-catch";
2
-
3
- import EventEmitter from "./../../src/js/util/eventEmitter";
4
-
5
- test("EventEmitter:", function (t) {
6
- t.test("can be instantiated", function (tt) {
7
- tt.plan(1);
8
-
9
- tt.doesNotThrow(function () {
10
- return new EventEmitter();
11
- });
12
- });
13
- });
@@ -1,21 +0,0 @@
1
- import test from "tape-catch";
2
-
3
- import humanize from "./../../src/js/util/humanize";
4
-
5
- test("humanize:", function (t) {
6
- t.test("filesize throws error on missing params", function (tt) {
7
- tt.plan(1);
8
-
9
- tt.throws(function () {
10
- humanize.filesize();
11
- });
12
- });
13
-
14
- t.test("toTime can be called", function (tt) {
15
- tt.plan(1);
16
-
17
- tt.doesNotThrow(function () {
18
- humanize.toTime();
19
- });
20
- });
21
- });
@@ -1,116 +0,0 @@
1
- import test from "tape-catch";
2
-
3
- import pretty from "./../../src/js/util/pretty";
4
-
5
- test("pretty:", function (t) {
6
- t.test("prettifies undefined fine", function (tt) {
7
- tt.plan(1);
8
-
9
- tt.equal(pretty(), "undefined");
10
- });
11
-
12
- t.test("prettifies null fine", function (tt) {
13
- tt.plan(1);
14
-
15
- tt.equal(pretty(null), "null");
16
- });
17
-
18
- t.test("prettifies a string fine", function (tt) {
19
- tt.plan(1);
20
-
21
- tt.equal(pretty("sorry"), "sorry");
22
- });
23
-
24
- t.test("prettifies a true boolean fine", function (tt) {
25
- tt.plan(1);
26
-
27
- tt.equal(pretty(true), "true");
28
- });
29
-
30
- t.test("prettifies a false boolean fine", function (tt) {
31
- tt.plan(1);
32
-
33
- tt.equal(pretty(false), "false");
34
- });
35
-
36
- t.test("prettifies an object fine", function (tt) {
37
- tt.plan(1);
38
-
39
- tt.equal(
40
- pretty({
41
- i: "am",
42
- just: "another",
43
- stupid: "object",
44
- empty: "",
45
- 2: 3,
46
- 4: null,
47
- }),
48
- '- 3<br/>- "am"<br/>- "another"<br/>- "object"',
49
- );
50
- });
51
-
52
- t.test("prettifies an array fine", function (tt) {
53
- tt.plan(1);
54
-
55
- tt.equal(
56
- pretty(["i", "am", "just", "another", "array", null, 1, 2]),
57
- '- "i"<br/>- "am"<br/>- "just"<br/>- "another"<br/>- "array"<br/>- 1<br/>- 2',
58
- );
59
- });
60
-
61
- t.test("prettifies can exclude object keys", function (tt) {
62
- tt.plan(4);
63
-
64
- tt.equal(
65
- pretty(
66
- {
67
- ignoreMe: "ignore me",
68
- includeMe: "keep me",
69
- },
70
- {
71
- excludes: null,
72
- },
73
- ),
74
- '- "ignore me"<br/>- "keep me"',
75
- );
76
-
77
- tt.equal(
78
- pretty(
79
- {
80
- ignoreMe: "ignore me",
81
- includeMe: "keep me",
82
- },
83
- {
84
- excludes: [],
85
- },
86
- ),
87
- '- "ignore me"<br/>- "keep me"',
88
- );
89
-
90
- tt.equal(
91
- pretty(
92
- {
93
- ignoreMe: "ignore me",
94
- includeMe: "keep me",
95
- },
96
- {
97
- excludes: ["something else"],
98
- },
99
- ),
100
- '- "ignore me"<br/>- "keep me"',
101
- );
102
-
103
- tt.equal(
104
- pretty(
105
- {
106
- ignoreMe: "ignore me",
107
- includeMe: "keep me",
108
- },
109
- {
110
- excludes: ["ignoreMe"],
111
- },
112
- ),
113
- '"keep me"',
114
- );
115
- });
116
- });