videomail-client 9.0.10 → 9.1.0
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/.vscode/settings.json
CHANGED
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
"source.sortPackageJson"
|
|
11
11
|
],
|
|
12
12
|
"cSpell.words": [
|
|
13
|
+
"animitter",
|
|
13
14
|
"bytediff",
|
|
14
15
|
"classlist",
|
|
15
16
|
"cssnano",
|
|
@@ -20,14 +21,17 @@
|
|
|
20
21
|
"gulpfile",
|
|
21
22
|
"hyperscript",
|
|
22
23
|
"keymirror",
|
|
24
|
+
"Mbit",
|
|
23
25
|
"packagejson",
|
|
24
26
|
"plusplus",
|
|
25
27
|
"preend",
|
|
26
28
|
"rubberband",
|
|
29
|
+
"Seeflow's",
|
|
27
30
|
"styl",
|
|
28
31
|
"Teleporting",
|
|
29
32
|
"videomail",
|
|
30
33
|
"videomails",
|
|
34
|
+
"websockets",
|
|
31
35
|
"xvfb"
|
|
32
36
|
]
|
|
33
37
|
}
|
package/package.json
CHANGED
|
@@ -17273,7 +17273,7 @@ function wrappy (fn, cb) {
|
|
|
17273
17273
|
},{}],114:[function(_dereq_,module,exports){
|
|
17274
17274
|
module.exports={
|
|
17275
17275
|
"name": "videomail-client",
|
|
17276
|
-
"version": "9.0
|
|
17276
|
+
"version": "9.1.0",
|
|
17277
17277
|
"description": "A wicked npm package to record videos directly in the browser, wohooo!",
|
|
17278
17278
|
"keywords": [
|
|
17279
17279
|
"webcam",
|
|
@@ -17484,7 +17484,7 @@ var VideomailClient = function VideomailClient(options) {
|
|
|
17484
17484
|
if (!parentElement) {
|
|
17485
17485
|
if (!container.isBuilt()) {
|
|
17486
17486
|
// this will try build all over again
|
|
17487
|
-
container.build();
|
|
17487
|
+
container.build(true);
|
|
17488
17488
|
}
|
|
17489
17489
|
if (!container.hasElement()) {
|
|
17490
17490
|
throw new Error("Unable to replay video without a container nor parent element.");
|
|
@@ -17510,12 +17510,8 @@ var VideomailClient = function VideomailClient(options) {
|
|
|
17510
17510
|
} else {
|
|
17511
17511
|
container.loadForm(videomail);
|
|
17512
17512
|
}
|
|
17513
|
-
|
|
17514
|
-
|
|
17515
|
-
setTimeout(function () {
|
|
17516
|
-
replay.setVideomail(videomail);
|
|
17517
|
-
container.showReplayOnly();
|
|
17518
|
-
}, 10e2); // not sure, but probably can be reduced a bit
|
|
17513
|
+
replay.setVideomail(videomail);
|
|
17514
|
+
container.showReplayOnly();
|
|
17519
17515
|
}
|
|
17520
17516
|
buildReplay();
|
|
17521
17517
|
};
|
|
@@ -17878,11 +17874,6 @@ var _default = exports.default = {
|
|
|
17878
17874
|
// define default subject line
|
|
17879
17875
|
body: null // define default body content
|
|
17880
17876
|
},
|
|
17881
|
-
/*
|
|
17882
|
-
* a special flag to indicate that everything to be initialized
|
|
17883
|
-
* serves only for playing existing videomails with the replay function
|
|
17884
|
-
*/
|
|
17885
|
-
playerOnly: false,
|
|
17886
17877
|
// show errors inside the container?
|
|
17887
17878
|
displayErrors: true,
|
|
17888
17879
|
// true = all form inputs get disabled and disappear when browser can't record
|
|
@@ -18495,6 +18486,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
18495
18486
|
});
|
|
18496
18487
|
exports.default = _default;
|
|
18497
18488
|
var _despot = _interopRequireDefault(_dereq_("despot"));
|
|
18489
|
+
var _safeJsonStringify = _interopRequireDefault(_dereq_("safe-json-stringify"));
|
|
18498
18490
|
var _events = _interopRequireDefault(_dereq_("./../events"));
|
|
18499
18491
|
var _videomailError = _interopRequireDefault(_dereq_("./videomailError"));
|
|
18500
18492
|
// TODO: MAKE EVENT EMITTING IN DESPOT NOT GLOBAL BUT BY CONTAINER ID INSTEAD
|
|
@@ -18519,9 +18511,9 @@ function _default(options, name) {
|
|
|
18519
18511
|
moreArguments = args.slice(1);
|
|
18520
18512
|
}
|
|
18521
18513
|
if (moreArguments) {
|
|
18522
|
-
options.debug("
|
|
18514
|
+
options.debug("".concat(name, " emits ").concat(event, " with ").concat((0, _safeJsonStringify.default)(moreArguments)));
|
|
18523
18515
|
} else {
|
|
18524
|
-
options.debug("
|
|
18516
|
+
options.debug("".concat(name, " emits ").concat(event));
|
|
18525
18517
|
}
|
|
18526
18518
|
}
|
|
18527
18519
|
}
|
|
@@ -18552,7 +18544,7 @@ function _default(options, name) {
|
|
|
18552
18544
|
};
|
|
18553
18545
|
}
|
|
18554
18546
|
|
|
18555
|
-
},{"./../events":117,"./videomailError":128,"@babel/runtime/helpers/interopRequireDefault":3,"despot":28}],124:[function(_dereq_,module,exports){
|
|
18547
|
+
},{"./../events":117,"./videomailError":128,"@babel/runtime/helpers/interopRequireDefault":3,"despot":28,"safe-json-stringify":97}],124:[function(_dereq_,module,exports){
|
|
18556
18548
|
"use strict";
|
|
18557
18549
|
|
|
18558
18550
|
var _interopRequireDefault = _dereq_("@babel/runtime/helpers/interopRequireDefault");
|
|
@@ -19795,15 +19787,16 @@ var Container = function Container(options) {
|
|
|
19795
19787
|
}
|
|
19796
19788
|
}
|
|
19797
19789
|
function buildChildren() {
|
|
19798
|
-
|
|
19790
|
+
var playerOnly = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
|
19791
|
+
debug("Container: buildChildren(playerOnly = ".concat(playerOnly, ")"));
|
|
19799
19792
|
if (!containerElement.classList) {
|
|
19800
19793
|
self.emit(_events.default.ERROR, _videomailError.default.create("Sorry, your browser is too old!", options));
|
|
19801
19794
|
} else {
|
|
19802
19795
|
containerElement.classList.add("videomail");
|
|
19803
|
-
if (!
|
|
19796
|
+
if (!playerOnly) {
|
|
19804
19797
|
buttons.build();
|
|
19805
19798
|
}
|
|
19806
|
-
visuals.build();
|
|
19799
|
+
visuals.build(playerOnly);
|
|
19807
19800
|
}
|
|
19808
19801
|
}
|
|
19809
19802
|
function processError(err) {
|
|
@@ -19820,13 +19813,14 @@ var Container = function Container(options) {
|
|
|
19820
19813
|
}
|
|
19821
19814
|
}
|
|
19822
19815
|
function initEvents() {
|
|
19823
|
-
|
|
19816
|
+
var playerOnly = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
|
19817
|
+
debug("Container: initEvents(playerOnly = ".concat(playerOnly, ")"));
|
|
19824
19818
|
if (options.enableAutoUnload) {
|
|
19825
19819
|
window.addEventListener("beforeunload", function (e) {
|
|
19826
19820
|
self.unload(e);
|
|
19827
19821
|
});
|
|
19828
19822
|
}
|
|
19829
|
-
if (!
|
|
19823
|
+
if (!playerOnly) {
|
|
19830
19824
|
visibility.onChange(function (visible) {
|
|
19831
19825
|
// built? see https://github.com/binarykitchen/videomail.io/issues/326
|
|
19832
19826
|
if (built) {
|
|
@@ -19845,7 +19839,7 @@ var Container = function Container(options) {
|
|
|
19845
19839
|
});
|
|
19846
19840
|
}
|
|
19847
19841
|
if (options.enableSpace) {
|
|
19848
|
-
if (!
|
|
19842
|
+
if (!playerOnly) {
|
|
19849
19843
|
window.addEventListener("keypress", function (e) {
|
|
19850
19844
|
var tagName = e.target.tagName;
|
|
19851
19845
|
var isEditable = e.target.isContentEditable || e.target.contentEditable === "true" || e.target.contentEditable === true;
|
|
@@ -19877,7 +19871,7 @@ var Container = function Container(options) {
|
|
|
19877
19871
|
removeDimensions();
|
|
19878
19872
|
}
|
|
19879
19873
|
});
|
|
19880
|
-
if (!
|
|
19874
|
+
if (!playerOnly) {
|
|
19881
19875
|
self.on(_events.default.LOADED_META_DATA, function () {
|
|
19882
19876
|
correctDimensions();
|
|
19883
19877
|
});
|
|
@@ -20037,6 +20031,8 @@ var Container = function Container(options) {
|
|
|
20037
20031
|
return Boolean(containerElement);
|
|
20038
20032
|
};
|
|
20039
20033
|
this.build = function () {
|
|
20034
|
+
var playerOnly = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
|
20035
|
+
debug("Container: build(playerOnly = ".concat(playerOnly, ")"));
|
|
20040
20036
|
try {
|
|
20041
20037
|
containerElement = document.getElementById(options.selectors.containerId);
|
|
20042
20038
|
|
|
@@ -20046,13 +20042,13 @@ var Container = function Container(options) {
|
|
|
20046
20042
|
*/
|
|
20047
20043
|
if (containerElement) {
|
|
20048
20044
|
options.insertCss && prependDefaultCss();
|
|
20049
|
-
!built && initEvents();
|
|
20045
|
+
!built && initEvents(playerOnly);
|
|
20050
20046
|
validateOptions();
|
|
20051
20047
|
correctDimensions();
|
|
20052
|
-
if (!
|
|
20048
|
+
if (!playerOnly) {
|
|
20053
20049
|
buildForm();
|
|
20054
20050
|
}
|
|
20055
|
-
buildChildren();
|
|
20051
|
+
buildChildren(playerOnly);
|
|
20056
20052
|
if (!hasError) {
|
|
20057
20053
|
debug("Container: built.");
|
|
20058
20054
|
built = true;
|
|
@@ -20517,6 +20513,7 @@ var _getFormData = _interopRequireDefault(_dereq_("get-form-data"));
|
|
|
20517
20513
|
var _hidden = _interopRequireDefault(_dereq_("hidden"));
|
|
20518
20514
|
var _hyperscript = _interopRequireDefault(_dereq_("hyperscript"));
|
|
20519
20515
|
var _inherits = _interopRequireDefault(_dereq_("inherits"));
|
|
20516
|
+
var _safeJsonStringify = _interopRequireDefault(_dereq_("safe-json-stringify"));
|
|
20520
20517
|
var _events = _interopRequireDefault(_dereq_("../events"));
|
|
20521
20518
|
var _eventEmitter = _interopRequireDefault(_dereq_("../util/eventEmitter"));
|
|
20522
20519
|
var _videomailError = _interopRequireDefault(_dereq_("../util/videomailError"));
|
|
@@ -20550,7 +20547,12 @@ var Form = function Form(container, formElement, options) {
|
|
|
20550
20547
|
Object.keys(FORM_FIELDS).forEach(function (key) {
|
|
20551
20548
|
var formFieldValue = FORM_FIELDS[key];
|
|
20552
20549
|
if (formFieldValue in formData) {
|
|
20553
|
-
|
|
20550
|
+
var value = formData[formFieldValue];
|
|
20551
|
+
if (value === "" || value === undefined) {
|
|
20552
|
+
// skip empty strings and undefined
|
|
20553
|
+
} else {
|
|
20554
|
+
transformedFormData[key] = value;
|
|
20555
|
+
}
|
|
20554
20556
|
}
|
|
20555
20557
|
});
|
|
20556
20558
|
if (transformedFormData.from) {
|
|
@@ -20731,9 +20733,11 @@ var Form = function Form(container, formElement, options) {
|
|
|
20731
20733
|
submitButton.onclick = null;
|
|
20732
20734
|
}
|
|
20733
20735
|
this.doTheSubmit = function (e) {
|
|
20734
|
-
debug("Form: doTheSubmit()", e);
|
|
20735
20736
|
if (e) {
|
|
20737
|
+
debug("Form: doTheSubmit(".concat((0, _safeJsonStringify.default)(e), ")"));
|
|
20736
20738
|
e.preventDefault();
|
|
20739
|
+
} else {
|
|
20740
|
+
debug("Form: doTheSubmit()");
|
|
20737
20741
|
}
|
|
20738
20742
|
|
|
20739
20743
|
/*
|
|
@@ -20779,7 +20783,7 @@ var Form = function Form(container, formElement, options) {
|
|
|
20779
20783
|
(0, _inherits.default)(Form, _eventEmitter.default);
|
|
20780
20784
|
var _default = exports.default = Form;
|
|
20781
20785
|
|
|
20782
|
-
},{"../events":117,"../util/eventEmitter":123,"../util/videomailError":128,"@babel/runtime/helpers/interopRequireDefault":3,"get-form-data":48,"hidden":59,"hyperscript":61,"inherits":64}],133:[function(_dereq_,module,exports){
|
|
20786
|
+
},{"../events":117,"../util/eventEmitter":123,"../util/videomailError":128,"@babel/runtime/helpers/interopRequireDefault":3,"get-form-data":48,"hidden":59,"hyperscript":61,"inherits":64,"safe-json-stringify":97}],133:[function(_dereq_,module,exports){
|
|
20783
20787
|
"use strict";
|
|
20784
20788
|
|
|
20785
20789
|
var _interopRequireDefault = _dereq_("@babel/runtime/helpers/interopRequireDefault");
|
|
@@ -20890,9 +20894,10 @@ var Visuals = function Visuals(container, options) {
|
|
|
20890
20894
|
}
|
|
20891
20895
|
}
|
|
20892
20896
|
function buildChildren() {
|
|
20893
|
-
|
|
20897
|
+
var playerOnly = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
|
20898
|
+
debug("Visuals: buildChildren(playerOnly = ".concat(playerOnly, ")"));
|
|
20894
20899
|
buildNoScriptTag();
|
|
20895
|
-
if (!
|
|
20900
|
+
if (!playerOnly) {
|
|
20896
20901
|
notifier.build();
|
|
20897
20902
|
recorderInsides.build();
|
|
20898
20903
|
}
|
|
@@ -20900,8 +20905,9 @@ var Visuals = function Visuals(container, options) {
|
|
|
20900
20905
|
debug("Visuals: built.");
|
|
20901
20906
|
}
|
|
20902
20907
|
function initEvents() {
|
|
20903
|
-
|
|
20904
|
-
|
|
20908
|
+
var playerOnly = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
|
20909
|
+
if (!playerOnly) {
|
|
20910
|
+
debug("Visuals: initEvents(playerOnly = ".concat(playerOnly, ")"));
|
|
20905
20911
|
self.on(_events.default.USER_MEDIA_READY, function () {
|
|
20906
20912
|
built = true;
|
|
20907
20913
|
self.endWaiting();
|
|
@@ -20955,6 +20961,7 @@ var Visuals = function Visuals(container, options) {
|
|
|
20955
20961
|
return recorderInsides.isCountingDown();
|
|
20956
20962
|
};
|
|
20957
20963
|
this.build = function () {
|
|
20964
|
+
var playerOnly = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
|
20958
20965
|
visualsElement = container.querySelector(".".concat(options.selectors.visualsClass));
|
|
20959
20966
|
if (!visualsElement) {
|
|
20960
20967
|
visualsElement = (0, _hyperscript.default)("div.".concat(options.selectors.visualsClass));
|
|
@@ -20978,8 +20985,8 @@ var Visuals = function Visuals(container, options) {
|
|
|
20978
20985
|
|
|
20979
20986
|
visualsElement.classList.add("visuals");
|
|
20980
20987
|
correctDimensions();
|
|
20981
|
-
!built && initEvents();
|
|
20982
|
-
buildChildren();
|
|
20988
|
+
!built && initEvents(playerOnly);
|
|
20989
|
+
buildChildren(playerOnly);
|
|
20983
20990
|
|
|
20984
20991
|
// needed for replay handling and container.isOutsideElementOf()
|
|
20985
20992
|
self.parentNode = visualsElement.parentNode;
|
|
@@ -22411,7 +22418,7 @@ var Recorder = function Recorder(visuals, replay) {
|
|
|
22411
22418
|
debug("Recorder: skipping loadUserMedia() because it is already asking for permission");
|
|
22412
22419
|
return false;
|
|
22413
22420
|
}
|
|
22414
|
-
debug("Recorder: loadUserMedia(
|
|
22421
|
+
debug("Recorder: loadUserMedia(".concat((0, _safeJsonStringify.default)(params), ")"));
|
|
22415
22422
|
self.emit(_events.default.LOADING_USER_MEDIA);
|
|
22416
22423
|
try {
|
|
22417
22424
|
userMediaTimeout = setTimeout(function () {
|
|
@@ -22435,7 +22442,11 @@ var Recorder = function Recorder(visuals, replay) {
|
|
|
22435
22442
|
}
|
|
22436
22443
|
function executeCommand(command) {
|
|
22437
22444
|
try {
|
|
22438
|
-
|
|
22445
|
+
if (command.args) {
|
|
22446
|
+
debug("Server commanded: ".concat(command.command, " with ").concat((0, _safeJsonStringify.default)(command.args)));
|
|
22447
|
+
} else {
|
|
22448
|
+
debug("Server commanded: ".concat(command.command));
|
|
22449
|
+
}
|
|
22439
22450
|
switch (command.command) {
|
|
22440
22451
|
case "ready":
|
|
22441
22452
|
this.emit(_events.default.SERVER_READY);
|
|
@@ -22492,7 +22503,11 @@ var Recorder = function Recorder(visuals, replay) {
|
|
|
22492
22503
|
cb && cb();
|
|
22493
22504
|
});
|
|
22494
22505
|
} else if (stream) {
|
|
22495
|
-
|
|
22506
|
+
if (args) {
|
|
22507
|
+
debug("$ ".concat(command, " with ").concat((0, _safeJsonStringify.default)(args)));
|
|
22508
|
+
} else {
|
|
22509
|
+
debug("$ ".concat(command));
|
|
22510
|
+
}
|
|
22496
22511
|
var commandObj = {
|
|
22497
22512
|
command: command,
|
|
22498
22513
|
args: args
|
|
@@ -22539,7 +22554,7 @@ var Recorder = function Recorder(visuals, replay) {
|
|
|
22539
22554
|
return userMedia.getAudioSampleRate();
|
|
22540
22555
|
};
|
|
22541
22556
|
this.stop = function (params) {
|
|
22542
|
-
debug("stop(
|
|
22557
|
+
debug("stop(".concat((0, _safeJsonStringify.default)(params), ")"));
|
|
22543
22558
|
var limitReached = params.limitReached;
|
|
22544
22559
|
this.emit(_events.default.STOPPING, limitReached);
|
|
22545
22560
|
loop.complete();
|
|
@@ -22644,7 +22659,7 @@ var Recorder = function Recorder(visuals, replay) {
|
|
|
22644
22659
|
}
|
|
22645
22660
|
}
|
|
22646
22661
|
this.validate = function () {
|
|
22647
|
-
return connected &&
|
|
22662
|
+
return connected && canvas === null;
|
|
22648
22663
|
};
|
|
22649
22664
|
this.isReady = function () {
|
|
22650
22665
|
return userMedia.isReady();
|
|
@@ -22654,7 +22669,11 @@ var Recorder = function Recorder(visuals, replay) {
|
|
|
22654
22669
|
if (e instanceof window.Event) {
|
|
22655
22670
|
params.eventType = e.type;
|
|
22656
22671
|
}
|
|
22657
|
-
|
|
22672
|
+
if (params) {
|
|
22673
|
+
debug("pause() at frame ".concat(framesCount, " with ").concat((0, _safeJsonStringify.default)(params)));
|
|
22674
|
+
} else {
|
|
22675
|
+
debug("pause() at frame ".concat(framesCount));
|
|
22676
|
+
}
|
|
22658
22677
|
userMedia.pause();
|
|
22659
22678
|
loop.stop();
|
|
22660
22679
|
this.emit(_events.default.PAUSED);
|