Cleanup of modal video manager.

This commit is contained in:
Karishma Chadha committed 2018-04-30 08:44:58 -04:00
1 parent 469ff96a88
commit 2ca0d8342d
1 file changed
+1 -14
+1 -14
View File
@@ -5,14 +5,10 @@ import VideoProvider from './video-provider.js';
class ModalVideoManager {
constructor (canvas) {
this._videoProvider = new VideoProvider();
/**
* Frame update interval
* @type number
*/
this._frameTimeout = 16;
this._canvas = canvas;
this._blankCanvasURL = this._canvas.toDataURL('image/png');
// These values are double the stage dimensions so that the resulting
// image does not have to get sized down to accomodate double resolution
this._canvasWidth = 960; // Double Stage Width
@@ -40,12 +36,6 @@ class ModalVideoManager {
_drawFrames () {
const video = this._videoProvider.video;
// const drawImage = () => this._canvas.getContext('2d').drawImage(video,
// // source x, y, width, height
// 0, 0, video.videoWidth, video.videoHeight,
// // dest x, y, width, height
// 0, 0, this._canvasWidth, this._canvasHeight
// );
this._videoFeedInterval = setInterval(() =>
this._canvas.getContext('2d').drawImage(video,
// source x, y, width, height
@@ -53,14 +43,11 @@ class ModalVideoManager {
// dest x, y, width, height
0, 0, this._canvasWidth, this._canvasHeight
), this._frameTimeout);
// drawImage();
}
takeSnapshot () {
clearInterval(this._videoFeedInterval);
// const currentCanvasURL =
return this._canvas.toDataURL('image/png');
// if (currentCanvasURL !== this._blankCanvasURL) return currentCanvasURL;
}
clearSnapshot () {