This commit is contained in:
Nicolas Constant 2019-02-27 23:16:29 -05:00
parent 580c886b57
commit 97d223feae
No known key found for this signature in database
GPG Key ID: 1E9F677FB01A5688
2 changed files with 8 additions and 9 deletions

View File

@ -2,13 +2,11 @@
<button class="media-viewer-canvas__close" title="close">
<fa-icon [icon]="faTimes"></fa-icon>
</button>
<img class="media-viewer-canvas__image" *ngIf="imageUrl" src="{{imageUrl}}" />
<video class="media-viewer-canvas__image" *ngIf="gifvUrl" role="application" loop autoplay
(click)="attachmentSelected(0)">
<img class="media-viewer-canvas__image" *ngIf="imageUrl" src="{{imageUrl}}" (click)="blockClick($event)"/>
<video class="media-viewer-canvas__image" *ngIf="gifvUrl" role="application" loop autoplay (click)="blockClick($event)">
<source src="{{ gifvUrl }}" type="video/mp4">
</video>
<video class="media-viewer-canvas__image" *ngIf="videoUrl" role="application" loop controls="controls"
(click)="attachmentSelected(0)">
<video class="media-viewer-canvas__image" *ngIf="videoUrl" role="application" loop controls="controls" (click)="blockClick($event)">
<source src="{{ videoUrl }}" type="video/mp4">
</video>
</div>

View File

@ -40,9 +40,6 @@ export class MediaViewerComponent implements OnInit {
}
private loadAttachment(attachment: Attachment) {
console.warn('attachment');
console.warn(attachment);
if (attachment.type === 'image') {
this.imageUrl = attachment.url;
} else if (attachment.type === 'gifv'){
@ -52,9 +49,13 @@ export class MediaViewerComponent implements OnInit {
}
}
close(): boolean {
this.closeSubject.next(true);
return false;
}
blockClick(event: any): boolean{
event.stopPropagation();
return false;
}
}