videomail-client 2.18.4 → 3.0.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.
@@ -1,20 +1,21 @@
1
- import Buttons from './buttons'
2
- import Dimension from './dimension'
3
- import EventEmitter from './../util/eventEmitter'
4
- import Events from './../events'
5
- import Form from './form'
6
- import OptionsWrapper from './optionsWrapper'
7
- import Resource from './../resource'
8
- import VideomailError from './../util/videomailError'
9
1
  import Visibility from 'document-visibility'
10
- import Visuals from './visuals'
11
- import css from './../../styles/css/main.min.css.js'
12
2
  // needed for IE 11
13
3
  import elementClosest from 'element-closest'
14
4
  import hidden from 'hidden'
15
5
  import insertCss from 'insert-css'
16
6
  import util from 'util'
17
7
 
8
+ import css from '../../styles/css/main.min.css.js'
9
+ import Events from '../events'
10
+ import Resource from '../resource'
11
+ import EventEmitter from '../util/eventEmitter'
12
+ import VideomailError from '../util/videomailError'
13
+ import Buttons from './buttons'
14
+ import Dimension from './dimension'
15
+ import Form from './form'
16
+ import OptionsWrapper from './optionsWrapper'
17
+ import Visuals from './visuals'
18
+
18
19
  elementClosest(window)
19
20
 
20
21
  const Container = function (options) {
@@ -509,9 +510,9 @@ const Container = function (options) {
509
510
  submitted = false
510
511
  form.show()
511
512
  visuals.back(params, function () {
512
- if (params.keepHidden) {
513
+ if (params && params.keepHidden) {
513
514
  // just enable form, do nothing else.
514
- // see example contact_form.html when you submit without videomil
515
+ // see example contact_form.html when you submit without videomail
515
516
  // and go back
516
517
  self.enableForm()
517
518
  } else {
@@ -995,6 +995,8 @@ const Recorder = function (visuals, replay, defaultOptions = {}) {
995
995
 
996
996
  ctx.drawImage(userMedia.getRawVisuals(), 0, 0, canvas.width, canvas.height)
997
997
 
998
+ const nanoseconds = Math.round(window.performance.now() * 1000000)
999
+
998
1000
  recordingBuffer = frame.toBuffer()
999
1001
  recordingBufferLength = recordingBuffer.length
1000
1002
 
@@ -1004,7 +1006,12 @@ const Recorder = function (visuals, replay, defaultOptions = {}) {
1004
1006
 
1005
1007
  bytesSum += recordingBufferLength
1006
1008
 
1007
- writeStream(recordingBuffer, {
1009
+ const timeControlBuffer = Buffer.from(
1010
+ stringify({ frameNumber: framesCount, timestamp: nanoseconds })
1011
+ )
1012
+ const frameBuffer = Buffer.concat([recordingBuffer, timeControlBuffer])
1013
+
1014
+ writeStream(frameBuffer, {
1008
1015
  frameNumber: framesCount,
1009
1016
  onFlushedCallback: onFlushed
1010
1017
  })
@@ -1,14 +1,13 @@
1
- import util from 'util'
2
- import h from 'hyperscript'
3
1
  import hidden from 'hidden'
2
+ import h from 'hyperscript'
3
+ import util from 'util'
4
4
 
5
- import Replay from './visuals/replay'
6
- import Recorder from './visuals/recorder'
7
- import Notifier from './visuals/notifier'
5
+ import Events from '../events'
6
+ import EventEmitter from '../util/eventEmitter'
8
7
  import RecorderInsides from './visuals/inside/recorderInsides'
9
-
10
- import EventEmitter from './../util/eventEmitter'
11
- import Events from './../events'
8
+ import Notifier from './visuals/notifier'
9
+ import Recorder from './visuals/recorder'
10
+ import Replay from './visuals/replay'
12
11
 
13
12
  const Visuals = function (container, options) {
14
13
  EventEmitter.call(this, options, 'Visuals')
@@ -189,7 +188,7 @@ const Visuals = function (container, options) {
189
188
  replay.hide()
190
189
  notifier.hide()
191
190
 
192
- if (params.keepHidden) {
191
+ if (params && params.keepHidden) {
193
192
  recorder.hide()
194
193
  cb && cb()
195
194
  } else {