我可以在灯箱中显示图像
但是当尝试在 ngx-lighbox 中播放视频时。但它不起作用。也没有收到任何错误
我使用了以下链接中的参考
https://therichpost.com/angular-9-angular-ngx-lightbox/
代码: HTML:
<div *ngFor="let image of _albums; let i=index">
<img [src]="image.thumb" (click)="open(i)" />
</div>
typescript:
_albums = [];
constructor(private _lightbox: Lightbox) {
for (let i = 1; i <= 4; i++) {
const src = 'https://themyth92.com/project/ngx-lightbox/demo/img/image' + i + '.jpg';
const caption = 'Image ' + i + ' caption here';
const thumb = 'https://themyth92.com/project/ngx-lightbox/demo/img/image' + i + '-thumb.jpg';
const album = {
src: src,caption: caption,thumb: thumb
};
this._albums.push(album);
}
}
open(index: number): void {
// open lightbox
this._lightbox.open(this._albums,index);
}