From f19ae793c0f2a3ab4c53e26889f1043098e22f2a Mon Sep 17 00:00:00 2001 From: Corey Frang Date: Wed, 4 Apr 2018 14:20:13 -0400 Subject: [PATCH] enableVideo - get rid of "requests" --- .../scratch3_video_sensing/index.js | 2 +- src/io/video.js | 35 +++---------------- 2 files changed, 5 insertions(+), 32 deletions(-) diff --git a/src/extensions/scratch3_video_sensing/index.js b/src/extensions/scratch3_video_sensing/index.js index 145a204d4..5fca73e53 100644 --- a/src/extensions/scratch3_video_sensing/index.js +++ b/src/extensions/scratch3_video_sensing/index.js @@ -345,7 +345,7 @@ class Scratch3VideoSensingBlocks { if (args.VIDEO_STATE === 'off' || state === 1) { this.runtime.ioDevices.video.disableVideo(); } else { - this.runtime.ioDevices.video.requestVideo(); + this.runtime.ioDevices.video.enableVideo(); this.runtime.ioDevices.video.mirror = args.VIDEO_STATE === 'on' || state === 2; } } diff --git a/src/io/video.js b/src/io/video.js index 545902f4e..da7e462d9 100644 --- a/src/io/video.js +++ b/src/io/video.js @@ -20,12 +20,6 @@ class Video { */ this._frameCacheTimeout = 16; - /** - * Store each request for video, so when all are released we can disable preview/video feed. - * @type Array. - */ - this._requests = []; - /** * DOM Video element * @private @@ -93,36 +87,15 @@ class Video { * Request video be enabled. Sets up video, creates video skin and enables preview. * * ioDevices.video.requestVideo() - * .then(({ release }) => { - * this.releaseVideo = release; - * }) * - * @return {Promise.} A request object with a "release" property that - * should be called when you are done with the video. + * @return {Promise.