support video in media-overlay #41
This commit is contained in:
parent
8bc73810ba
commit
580c886b57
|
@ -3,7 +3,12 @@
|
||||||
<fa-icon [icon]="faTimes"></fa-icon>
|
<fa-icon [icon]="faTimes"></fa-icon>
|
||||||
</button>
|
</button>
|
||||||
<img class="media-viewer-canvas__image" *ngIf="imageUrl" src="{{imageUrl}}" />
|
<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)">
|
<video class="media-viewer-canvas__image" *ngIf="gifvUrl" role="application" loop autoplay
|
||||||
<source src="{{ gifvUrl }}" type="video/mp4">
|
(click)="attachmentSelected(0)">
|
||||||
</video>
|
<source src="{{ gifvUrl }}" type="video/mp4">
|
||||||
|
</video>
|
||||||
|
<video class="media-viewer-canvas__image" *ngIf="videoUrl" role="application" loop controls="controls"
|
||||||
|
(click)="attachmentSelected(0)">
|
||||||
|
<source src="{{ videoUrl }}" type="video/mp4">
|
||||||
|
</video>
|
||||||
</div>
|
</div>
|
|
@ -19,6 +19,7 @@ export class MediaViewerComponent implements OnInit {
|
||||||
|
|
||||||
imageUrl: string;
|
imageUrl: string;
|
||||||
gifvUrl: string;
|
gifvUrl: string;
|
||||||
|
videoUrl: string;
|
||||||
|
|
||||||
@Input('openedMediaEvent')
|
@Input('openedMediaEvent')
|
||||||
set openedMediaEvent(value: OpenMediaEvent) {
|
set openedMediaEvent(value: OpenMediaEvent) {
|
||||||
|
@ -46,12 +47,13 @@ export class MediaViewerComponent implements OnInit {
|
||||||
this.imageUrl = attachment.url;
|
this.imageUrl = attachment.url;
|
||||||
} else if (attachment.type === 'gifv'){
|
} else if (attachment.type === 'gifv'){
|
||||||
this.gifvUrl = attachment.url;
|
this.gifvUrl = attachment.url;
|
||||||
|
} else if (attachment.type === 'video'){
|
||||||
|
this.videoUrl = attachment.url;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
close(): boolean {
|
close(): boolean {
|
||||||
console.warn('xclose media');
|
|
||||||
this.closeSubject.next(true);
|
this.closeSubject.next(true);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue