diff --git a/projects/ucap-webmessenger-ui/src/lib/components/file-viewer/video-viewer.component.html b/projects/ucap-webmessenger-ui/src/lib/components/file-viewer/video-viewer.component.html
index e53a7a22..d09bda20 100644
--- a/projects/ucap-webmessenger-ui/src/lib/components/file-viewer/video-viewer.component.html
+++ b/projects/ucap-webmessenger-ui/src/lib/components/file-viewer/video-viewer.component.html
@@ -86,14 +86,22 @@
diff --git a/projects/ucap-webmessenger-ui/src/lib/components/file-viewer/video-viewer.component.ts b/projects/ucap-webmessenger-ui/src/lib/components/file-viewer/video-viewer.component.ts
index de03c16e..a6c9c50c 100644
--- a/projects/ucap-webmessenger-ui/src/lib/components/file-viewer/video-viewer.component.ts
+++ b/projects/ucap-webmessenger-ui/src/lib/components/file-viewer/video-viewer.component.ts
@@ -5,12 +5,14 @@ import {
Output,
EventEmitter,
ViewChild,
- ElementRef
+ ElementRef,
+ ChangeDetectorRef
} from '@angular/core';
import { ucapAnimations } from '../../animations';
import { FileEventJson } from '@ucap-webmessenger/protocol-event';
import { MatSlider, MatSliderChange } from '@angular/material';
import { FileDownloadItem } from '@ucap-webmessenger/api';
+import { NGXLogger } from 'ngx-logger';
@Component({
selector: 'ucap-video-viewer',
@@ -38,13 +40,21 @@ export class VideoViewerComponent implements OnInit {
timeSlider: MatSlider;
playing = false;
- duration = 0.01;
- currentTime = 0;
+ duration = 0.0;
+ currentTime = 0.0;
volume = 0.1;
loading = false;
fileDownloadItem: FileDownloadItem;
- constructor() {}
+ videoWidth = 0;
+ videoHeight = 0;
+
+ Math = Math;
+
+ constructor(
+ private changeDetectorRef: ChangeDetectorRef,
+ private logger: NGXLogger
+ ) {}
ngOnInit() {}
@@ -74,11 +84,11 @@ export class VideoViewerComponent implements OnInit {
}
onTimeUpdateVideo(): void {
- this.currentTime = Math.floor(this.audioPlayer.nativeElement.currentTime);
+ this.currentTime = this.audioPlayer.nativeElement.currentTime;
}
onVolumeChangeVideo(): void {
- this.volume = Math.floor(this.audioPlayer.nativeElement.volume);
+ this.volume = this.audioPlayer.nativeElement.volume;
}
onLoadStartVideo(): void {
@@ -87,7 +97,10 @@ export class VideoViewerComponent implements OnInit {
onLoadedDataVideo(): void {
this.loading = false;
- this.duration = Math.floor(this.audioPlayer.nativeElement.duration);
+ this.duration = this.audioPlayer.nativeElement.duration;
+
+ this.videoWidth = this.audioPlayer.nativeElement.videoWidth;
+ this.videoHeight = this.audioPlayer.nativeElement.videoHeight;
}
onClickDownload(): void {