aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/nodes/VideoBox.tsx
diff options
context:
space:
mode:
authorbobzel <zzzman@gmail.com>2024-08-08 12:27:40 -0400
committerbobzel <zzzman@gmail.com>2024-08-08 12:27:40 -0400
commit4574b7f03ccc85c4bebdbfd9475788456086704f (patch)
treed23d30343541b9af029ef418492d629d3cc710d7 /src/client/views/nodes/VideoBox.tsx
parente1db06d59d580aa640212a0d3a6aeecb9122bdf0 (diff)
many changes to add typing in place of 'any's etc
Diffstat (limited to 'src/client/views/nodes/VideoBox.tsx')
-rw-r--r--src/client/views/nodes/VideoBox.tsx18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/client/views/nodes/VideoBox.tsx b/src/client/views/nodes/VideoBox.tsx
index 1f285b300..4933869a7 100644
--- a/src/client/views/nodes/VideoBox.tsx
+++ b/src/client/views/nodes/VideoBox.tsx
@@ -125,8 +125,8 @@ export class VideoBox extends ViewBoxAnnotatableComponent<FieldViewProps>() {
}
override PlayerTime = () => this.player?.currentTime;
- override Pause = (update: boolean = true) => {
- this.pause(update);
+ override Pause = () => {
+ this.pause(true);
!this._keepCurrentlyPlaying && this.removeCurrentlyPlaying();
};
@@ -157,7 +157,7 @@ export class VideoBox extends ViewBoxAnnotatableComponent<FieldViewProps>() {
};
// plays video
- @action public Play = (update: boolean = true) => {
+ @action public Play = () => {
if (this._playRegionTimer) return;
this._playing = true;
@@ -172,8 +172,8 @@ export class VideoBox extends ViewBoxAnnotatableComponent<FieldViewProps>() {
}
try {
this._audioPlayer && this.player && (this._audioPlayer.currentTime = this.player?.currentTime);
- update && this.player && this.playFrom(start, undefined, true);
- update && this._audioPlayer?.play();
+ this.player && this.playFrom(start, undefined, true);
+ this._audioPlayer?.play();
} catch (e) {
console.log('Video Play Exception:', e);
}
@@ -384,7 +384,7 @@ export class VideoBox extends ViewBoxAnnotatableComponent<FieldViewProps>() {
getVideoThumbnails = () => {
if (this.dataDoc[this.fieldKey + '_thumbnails'] !== undefined) return;
this.dataDoc[this.fieldKey + '_thumbnails'] = new List<string>();
- const thumbnailPromises: Promise<any>[] = [];
+ const thumbnailPromises: Promise<string>[] = [];
const video = document.createElement('video');
video.onloadedmetadata = () => {
@@ -467,7 +467,7 @@ export class VideoBox extends ViewBoxAnnotatableComponent<FieldViewProps>() {
runInAction(() => {
this._screenCapture = !this._screenCapture;
});
- this._videoRef!.srcObject = !this._screenCapture ? null : await (navigator.mediaDevices).getDisplayMedia({ video: true });
+ this._videoRef!.srcObject = !this._screenCapture ? null : await navigator.mediaDevices.getDisplayMedia({ video: true });
},
icon: 'expand-arrows-alt',
});
@@ -557,9 +557,9 @@ export class VideoBox extends ViewBoxAnnotatableComponent<FieldViewProps>() {
style={this._fullScreen ? this.fullScreenSize() : this.isCropped ? { width: 'max-content', height: 'max-content', transform: `scale(${1 / NumCast(this.layoutDoc._freeform_scale)})`, transformOrigin: 'top left' } : {}}
onCanPlay={this.videoLoad}
controls={false}
- onPlay={() => this.Play()}
+ onPlay={this.Play}
onSeeked={this.updateTimecode}
- onPause={() => this.Pause()}
+ onPause={this.Pause}
onClick={this._fullScreen ? () => (this.playing() ? this.Pause() : this.Play()) : e => e.preventDefault()}>
<source src={field.url.href} type="video/mp4" />
Not supported.