aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/nodes/ScreenshotBox.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'src/client/views/nodes/ScreenshotBox.tsx')
-rw-r--r--src/client/views/nodes/ScreenshotBox.tsx18
1 files changed, 10 insertions, 8 deletions
diff --git a/src/client/views/nodes/ScreenshotBox.tsx b/src/client/views/nodes/ScreenshotBox.tsx
index 603dcad5c..4677e0e61 100644
--- a/src/client/views/nodes/ScreenshotBox.tsx
+++ b/src/client/views/nodes/ScreenshotBox.tsx
@@ -171,19 +171,21 @@ export class ScreenshotBox extends ViewBoxAnnotatableComponent<FieldViewProps>()
ContextMenu.Instance.addItem({ description: 'Options...', subitems, icon: 'video' });
};
+ setRef = (r: HTMLVideoElement | null) => {
+ this._videoRef = r;
+ setTimeout(() => {
+ if (this.layoutDoc.mediaState === mediaState.PendingRecording && this._videoRef) {
+ this.toggleRecording();
+ }
+ }, 100);
+ };
+
@computed get content() {
return (
<video
className="videoBox-content"
key="video"
- ref={r => {
- this._videoRef = r;
- setTimeout(() => {
- if (this.layoutDoc.mediaState === mediaState.PendingRecording && this._videoRef) {
- this.toggleRecording();
- }
- }, 100);
- }}
+ ref={this.setRef}
autoPlay={this._screenCapture}
style={{ width: this._screenCapture ? '100%' : undefined, height: this._screenCapture ? '100%' : undefined }}
onCanPlay={this.videoLoad}