From 4d2de73e623867f01dc4a48dc8af7e2113f27fc2 Mon Sep 17 00:00:00 2001 From: Thijs Triemstra Date: Tue, 19 May 2020 21:23:00 +0200 Subject: [PATCH] ask again for device permissions in Firefox when user cleared them manually (#468) --- CHANGES.md | 2 ++ src/js/videojs.record.js | 8 +++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/CHANGES.md b/CHANGES.md index b3325364..433f6fc6 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -6,6 +6,8 @@ `exportImage` (#417) - Fix file extension for `video/x-matroska` mime-type (#464, #469) - Fix milliseconds in `formatTime` (#443) +- Ask again for device permissions in Firefox when user cleared them + manually (#468) - Move documentation to website (#472) - Bump required version for: - video.js (7.0.5 or newer) diff --git a/src/js/videojs.record.js b/src/js/videojs.record.js index 7116e38d..a3d15686 100644 --- a/src/js/videojs.record.js +++ b/src/js/videojs.record.js @@ -472,7 +472,7 @@ class Record extends Plugin { } }; } - // open browser device selection dialog + // open browser device selection/permissions dialog this.surfer.surfer.microphone.start(); break; @@ -811,6 +811,12 @@ class Record extends Plugin { */ start() { if (!this.isProcessing()) { + // check if user didn't revoke permissions after a previous recording + if (this.stream && this.stream.active === false) { + // ask for permissions again + this.getDevice(); + return; + } this._recording = true; // hide play/pause control