From e3ac007e51b00065b214dc638c957e3cf86b48ee Mon Sep 17 00:00:00 2001 From: andrewdkim Date: Tue, 1 Oct 2019 17:55:04 -0400 Subject: new changes --- src/client/views/webcam/DashWebRTC.tsx | 47 ++++++++++++++++++++++++++++++---- 1 file changed, 42 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/client/views/webcam/DashWebRTC.tsx b/src/client/views/webcam/DashWebRTC.tsx index 451437429..c04a6d739 100644 --- a/src/client/views/webcam/DashWebRTC.tsx +++ b/src/client/views/webcam/DashWebRTC.tsx @@ -1,8 +1,12 @@ import { observer } from "mobx-react"; import React = require("react"); import { CollectionFreeFormDocumentViewProps } from "../nodes/CollectionFreeFormDocumentView"; -import { FieldViewProps } from "../nodes/FieldView"; +import { FieldViewProps, FieldView } from "../nodes/FieldView"; import { observable } from "mobx"; +import { DocumentDecorations } from "../DocumentDecorations"; +import { InkingControl } from "../InkingControl"; +import "../../views/nodes/WebBox.scss"; + const mediaStreamConstaints = { @@ -11,7 +15,7 @@ const mediaStreamConstaints = { @observer -export class DashWebRTC extends React.Component<{}> { +export class DashWebRTC extends React.Component { @observable private videoEl: HTMLVideoElement | undefined; @observable private localStream: MediaStream | undefined; @@ -33,13 +37,46 @@ export class DashWebRTC extends React.Component<{}> { } + public static LayoutString() { return FieldView.LayoutString(DashWebRTC); } + + + _ignore = 0; + onPreWheel = (e: React.WheelEvent) => { + this._ignore = e.timeStamp; + } + onPrePointer = (e: React.PointerEvent) => { + this._ignore = e.timeStamp; + } + onPostPointer = (e: React.PointerEvent) => { + if (this._ignore !== e.timeStamp) { + e.stopPropagation(); + } + } + onPostWheel = (e: React.WheelEvent) => { + if (this._ignore !== e.timeStamp) { + e.stopPropagation(); + } + } + render() { - return ( -
+ let content = +
-
+
; + + let frozen = !this.props.isSelected() || DocumentDecorations.Instance.Interacting; + let classname = "webBox-cont" + (this.props.isSelected() && !InkingControl.Instance.selectedTool && !DocumentDecorations.Instance.Interacting ? "-interactive" : ""); + + + return ( + <> +
+ {content} +
+ {!frozen ? (null) :
} + ); ); } -- cgit v1.2.3-70-g09d2