From 36992ca2388e2a6919ecf0b78f4731bc9aea8f86 Mon Sep 17 00:00:00 2001 From: bob Date: Thu, 11 Jul 2019 16:05:37 -0400 Subject: added video controls --- src/client/views/nodes/VideoBox.scss | 6 +++++- src/client/views/nodes/VideoBox.tsx | 29 ++++++++++++++++++++++++----- 2 files changed, 29 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/client/views/nodes/VideoBox.scss b/src/client/views/nodes/VideoBox.scss index 35db64cf4..55f2fe7c5 100644 --- a/src/client/views/nodes/VideoBox.scss +++ b/src/client/views/nodes/VideoBox.scss @@ -1,8 +1,12 @@ -.videoBox-cont, .videoBox-cont-fullScreen{ +.videoBox-cont, .videoBox-cont-interactive, .videoBox-cont-fullScreen { width: 100%; height: Auto; } +.videoBox-cont-interactive { + pointer-events: all; +} + .videoBox-cont-fullScreen { pointer-events: all; } \ No newline at end of file diff --git a/src/client/views/nodes/VideoBox.tsx b/src/client/views/nodes/VideoBox.tsx index 264d3c1f7..a5e145856 100644 --- a/src/client/views/nodes/VideoBox.tsx +++ b/src/client/views/nodes/VideoBox.tsx @@ -12,6 +12,9 @@ import { positionSchema } from "./DocumentView"; import { FieldView, FieldViewProps } from './FieldView'; import { pageSchema } from "./ImageBox"; import "./VideoBox.scss"; +import { ContextMenu } from "../ContextMenu"; +import { ContextMenuProps } from "../ContextMenuItem"; +import { InkingControl } from "../InkingControl"; type VideoDocument = makeInterface<[typeof positionSchema, typeof pageSchema]>; const VideoDocument = makeInterface(positionSchema, pageSchema); @@ -119,7 +122,17 @@ export class VideoBox extends DocComponent(VideoD }); } onPointerDown = (e: React.PointerEvent) => { - e.stopPropagation(); + } + + @observable static _showControls: boolean = false; + + specificContextMenu = (e: React.MouseEvent): void => { + let field = Cast(this.Document[this.props.fieldKey], VideoField); + if (field) { + let subitems: ContextMenuProps[] = []; + subitems.push({ description: "Toggle Show Controls", event: action(() => VideoBox._showControls = !VideoBox._showControls), icon: "expand-arrows-alt" }); + ContextMenu.Instance.addItem({ description: "Video Funcs...", subitems: subitems }); + } } render() { @@ -132,11 +145,17 @@ export class VideoBox extends DocComponent(VideoD // }); // // - let style = "videoBox-cont" + (this._fullScreen ? "-fullScreen" : ""); + let interactive = InkingControl.Instance.selectedTool ? "" : "-interactive"; + let style = "videoBox-cont" + (this._fullScreen ? "-fullScreen" : interactive); return !field ?
Loading
: -