<div class="media-viewer-canvas noselect">
    <div class="background__close" (click)="close()"></div>

    <a href class="media-viewer-canvas__close media-viewer-canvas__button" title="close" (click)="close()">
        <fa-icon [icon]="faTimes"></fa-icon>
    </a>

    <a href class="media-viewer-canvas__previous media-viewer-canvas__button" title="previous"
        (click)="previous($event)" *ngIf="previousAvailable">
        <fa-icon [icon]="faAngleLeft"></fa-icon>
    </a>

    <a href class="media-viewer-canvas__next media-viewer-canvas__button" title="next" (click)="next($event)"
        *ngIf="nextAvailable">
        <fa-icon [icon]="faAngleRight"></fa-icon>
    </a>

    <div *ngFor="let att of attachments" class="media-viewer-canvas__attachement"
        [class.collapsed]="currentIndex !== att.index">
        <a href="{{att.url}}" target="_blank" title="{{att.description}}">
            <img *ngIf="att.type === 'image'" src="{{att.url}}" class="media-viewer-canvas__image"   [class.collapsed]="currentIndex !== att.index" />
        </a>

        <video *ngIf="att.type === 'gifv'" class="media-viewer-canvas__image" role="application" loop autoplay [class.collapsed]="currentIndex !== att.index">
            <source src="{{att.url}}" type="video/mp4">
        </video>
        <video *ngIf="att.type === 'video'" class="media-viewer-canvas__image" role="application" loop autoplay
            controls="controls">
            <source src="{{att.url}}" type="video/mp4">
        </video>
    </div>

    <div #video *ngIf="html" class="media-viewer-canvas__image media-viewer-canvas__iframe" [innerHTML]="html">
    </div>
</div>