videomail-client 2.18.0 → 2.18.3

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.
@@ -356,6 +356,10 @@ const Browser = function (options) {
356
356
  return isOkSafari
357
357
  }
358
358
 
359
+ this.isIOS = function () {
360
+ return isIOS
361
+ }
362
+
359
363
  this.getUsefulData = function () {
360
364
  return {
361
365
  browser: uaParser.browser,
@@ -403,19 +403,27 @@ const Recorder = function (visuals, replay, defaultOptions = {}) {
403
403
 
404
404
  connecting = connected = false
405
405
 
406
- // setting custom text since that err object isn't really an error
407
- // on iphones when locked, and unlocked, this err is actually
408
- // an event object with stuff we can't use at all (an external bug)
409
- //
410
- // or else it could be a poor wifi connection...
411
- self.emit(
412
- Events.ERROR,
413
- VideomailError.create(
406
+ let videomailError
407
+
408
+ if (browser.isIOS()) {
409
+ // setting custom text since that err object isn't really an error
410
+ // on iphones when locked, and unlocked, this err is actually
411
+ // an event object with stuff we can't use at all (an external bug)
412
+ videomailError = VideomailError.create(
413
+ 'Sorry, connection has timed out',
414
+ 'iPhones cannot maintain a websocket longer than three minutes.',
415
+ options
416
+ )
417
+ } else {
418
+ // or else it could be a poor wifi connection...
419
+ videomailError = VideomailError.create(
414
420
  'Data exchange interrupted',
415
421
  'Please check your network connection and reload.',
416
422
  options
417
423
  )
418
- )
424
+ }
425
+
426
+ self.emit(Events.ERROR, videomailError)
419
427
  })
420
428
 
421
429
  // just experimental