← All changelog entries

New JavaScript Events and Method for File Uploads

New Improvement Fix

You can now follow and control uploads of existing files from your own code, with the main recording client and the legacy mobile recorder.

In the JavaScript Events API:

  • NEW: the new cancelUpload() method stops the upload in progress, the same way the Cancel upload link does. It returns true if an upload was cancelled and false if there was no upload in progress;
  • NEW: the new onDesktopVideoUploadCancelled() and onVideoUploadCancelled() events trigger when the user clicks Cancel upload or your code calls cancelUpload();
  • NEW: the new onDesktopVideoUploadRetrying() and onVideoUploadRetrying() events trigger when a retry attempt is scheduled, with the attempt number, the number of seconds until the retry will be triggered, and the reason for it (network, stalled, timeout, rateLimited, serverError or invalidResponse);
  • NEW: the new onDesktopVideoUploadRegionFallback() and onVideoUploadRegionFallback() events trigger when an upload switches to the fallback region, with the host name of the upload server used from then on;
  • FIX: onDesktopVideoUploadFailed() and onVideoUploadFailed() now trigger. They trigger whenever an upload ends without the recording being saved: when the file is refused before it is uploaded and when our upload servers refuse the upload. They now also receive a third parameter (details) with the status, code and message of the error;
  • IMPROVEMENT: onDesktopVideoUploadStarted() now triggers only once per file, including for a file that is refused before it is uploaded. Previously it triggered again for every retry attempt;
  • IMPROVEMENT: onDesktopVideoUploadProgress() and onVideoUploadProgress() trigger once per whole percentage. Previously they could trigger many times with the same percentage.

The TypeScript types in the @addpipe/pipe-recording-client NPM package include the new methods, events and parameter.

Build slug: 89e4773ae

NPM version: 2.0.14