[ISSUE 113] fixed
This commit is contained in:
parent
dd6bbc42f9
commit
e307cdb3b6
|
@ -66,10 +66,19 @@
|
||||||
<video
|
<video
|
||||||
controls
|
controls
|
||||||
controlsList="nodownload nofullscreen"
|
controlsList="nodownload nofullscreen"
|
||||||
*ngIf="selectedFile.info.type === FileType.Video"
|
|
||||||
[src]="getImageUrl(selectedFile)"
|
|
||||||
class="preview-video"
|
class="preview-video"
|
||||||
|
#videoPlayer
|
||||||
|
*ngIf="selectedFile.info.type === FileType.Video && playable"
|
||||||
|
[src]="getImageUrl(selectedFile)"
|
||||||
|
(loadeddata)="onLoadedDataVideo()"
|
||||||
></video>
|
></video>
|
||||||
|
<div
|
||||||
|
*ngIf="selectedFile.info.type === FileType.Video && !playable"
|
||||||
|
fxFlexFill
|
||||||
|
class="guide-msg"
|
||||||
|
>
|
||||||
|
{{ 'common.file.errors.cantPlay' | translate }}
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<ul>
|
<ul>
|
||||||
<li class="name">{{ selectedFile.info.name }}</li>
|
<li class="name">{{ selectedFile.info.name }}</li>
|
||||||
|
|
|
@ -1,4 +1,11 @@
|
||||||
import { Component, OnInit, OnDestroy, Inject } from '@angular/core';
|
import {
|
||||||
|
Component,
|
||||||
|
OnInit,
|
||||||
|
OnDestroy,
|
||||||
|
Inject,
|
||||||
|
ElementRef,
|
||||||
|
ViewChild
|
||||||
|
} from '@angular/core';
|
||||||
import {
|
import {
|
||||||
FileInfo,
|
FileInfo,
|
||||||
FileDownloadInfo,
|
FileDownloadInfo,
|
||||||
|
@ -45,6 +52,9 @@ export interface FileInfoTotal {
|
||||||
styleUrls: ['./album-box.component.scss']
|
styleUrls: ['./album-box.component.scss']
|
||||||
})
|
})
|
||||||
export class AlbumBoxComponent implements OnInit, OnDestroy {
|
export class AlbumBoxComponent implements OnInit, OnDestroy {
|
||||||
|
@ViewChild('videoPlayer', { static: false })
|
||||||
|
videoPlayer: ElementRef<HTMLVideoElement>;
|
||||||
|
|
||||||
filteredList: FileInfoTotal[] = [];
|
filteredList: FileInfoTotal[] = [];
|
||||||
fileInfoTotal: FileInfoTotal[];
|
fileInfoTotal: FileInfoTotal[];
|
||||||
fileInfoList: FileInfo[];
|
fileInfoList: FileInfo[];
|
||||||
|
@ -62,6 +72,8 @@ export class AlbumBoxComponent implements OnInit, OnDestroy {
|
||||||
|
|
||||||
thumbBaseUrl: string;
|
thumbBaseUrl: string;
|
||||||
|
|
||||||
|
playable = true;
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
private store: Store<any>,
|
private store: Store<any>,
|
||||||
private sessionStorageService: SessionStorageService,
|
private sessionStorageService: SessionStorageService,
|
||||||
|
@ -186,6 +198,7 @@ export class AlbumBoxComponent implements OnInit, OnDestroy {
|
||||||
event.stopPropagation();
|
event.stopPropagation();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this.playable = true;
|
||||||
this.selectedFile = fileInfo;
|
this.selectedFile = fileInfo;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -323,4 +336,13 @@ export class AlbumBoxComponent implements OnInit, OnDestroy {
|
||||||
this.logger.error(reason);
|
this.logger.error(reason);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
onLoadedDataVideo(): void {
|
||||||
|
if (
|
||||||
|
0 === this.videoPlayer.nativeElement.videoWidth ||
|
||||||
|
0 === this.videoPlayer.nativeElement.videoHeight
|
||||||
|
) {
|
||||||
|
this.playable = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user