From 13c9408ee4af7b9690db68c51ad05956dd964347 Mon Sep 17 00:00:00 2001 From: jmoenig Date: Mon, 18 Nov 2019 17:37:06 +0100 Subject: [PATCH] only report video capture as "on" when the camera actually records something --- HISTORY.md | 2 ++ snap.html | 2 +- src/threads.js | 8 ++++++-- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/HISTORY.md b/HISTORY.md index 58306ea4..ec619f7c 100755 --- a/HISTORY.md +++ b/HISTORY.md @@ -4,10 +4,12 @@ * **New Features:** * **Notable Changes:** * **Notable Fixes:** + * only report video capture as "on" when the camera actually records something * **Translation Updates:** ### 2019-11-18 * new dev version +* threads: only report video capture as "on" when the camera actually records something ## v5.3.6: * **Notable Fix:** diff --git a/snap.html b/snap.html index ca6f9f7b..b7c16510 100755 --- a/snap.html +++ b/snap.html @@ -7,7 +7,7 @@ - + diff --git a/src/threads.js b/src/threads.js index dc127493..58e3fc5a 100644 --- a/src/threads.js +++ b/src/threads.js @@ -61,7 +61,7 @@ StageMorph, SpriteMorph, StagePrompterMorph, Note, modules, isString, copy, isNil, WatcherMorph, List, ListWatcherMorph, alert, console, TableMorph, Color, TableFrameMorph, ColorSlotMorph, isSnapObject, Map, newCanvas, Symbol*/ -modules.threads = '2019-November-13'; +modules.threads = '2019-November-18'; var ThreadManager; var Process; @@ -2099,7 +2099,11 @@ Process.prototype.reportGlobalFlag = function (name) { case 'flat line ends': return SpriteMorph.prototype.useFlatLineEnds; case 'video capture': - return !isNil(stage.projectionSource); + return !isNil(stage.projectionSource) && + stage.projectionLayer() + .getContext('2d') + .getImageData(0, 0, 1, 1) + .data[3] > 0; case 'mirror video': return stage.mirrorVideo; default: