aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/nodes/VideoBox.tsx
diff options
context:
space:
mode:
authorSam Wilkins <samwilkins333@gmail.com>2019-07-11 18:14:36 -0400
committerSam Wilkins <samwilkins333@gmail.com>2019-07-11 18:14:36 -0400
commit1d93275d4202e1243c6c9349114b18c76ed45bbb (patch)
treeea17225c58def44a7f83d2234bf8dae73538b398 /src/client/views/nodes/VideoBox.tsx
parent8bd402c9ac403fdaed9b532d02094c08f9622ab3 (diff)
parentaeb0521e8ad8f1efc8c3a39af9eb5443c5368453 (diff)
merged with master
Diffstat (limited to 'src/client/views/nodes/VideoBox.tsx')
-rw-r--r--src/client/views/nodes/VideoBox.tsx20
1 files changed, 17 insertions, 3 deletions
diff --git a/src/client/views/nodes/VideoBox.tsx b/src/client/views/nodes/VideoBox.tsx
index 264d3c1f7..c65dfe0bd 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<FieldViewProps, VideoDocument>(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,9 +145,10 @@ export class VideoBox extends DocComponent<FieldViewProps, VideoDocument>(VideoD
// });
// //
- let style = "videoBox-cont" + (this._fullScreen ? "-fullScreen" : "");
+ let interactive = InkingControl.Instance.selectedTool ? "" : "-interactive";
+ let style = "videoBox-cont" + (this._fullScreen ? "-fullScreen" : interactive);
return !field ? <div>Loading</div> :
- <video className={`${style}`} ref={this.setVideoRef} onCanPlay={this.videoLoad} onPointerDown={this.onPointerDown}>
+ <video className={`${style}`} ref={this.setVideoRef} onCanPlay={this.videoLoad} onPointerDown={this.onPointerDown} onContextMenu={this.specificContextMenu} controls={VideoBox._showControls}>
<source src={field.url.href} type="video/mp4" />
Not supported.
</video>;