Skip to content

Commit

Permalink
Use webp images
Browse files Browse the repository at this point in the history
  • Loading branch information
Maxim Palenov committed Sep 18, 2019
1 parent 8c67bc2 commit bf371b6
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
<div class="wrapper">
<video class="image" *ngIf="src" [width]="width" [height]="height" autoplay loop>
<source [src]="src" type="video/mp4">
</video>
<img *ngIf="src" [src]="src" [width]="width" [height]="height">
<div class="panel">
<mat-icon (click)="onLinkIconClick()">link</mat-icon>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ describe('GifImageComponent', () => {
component.gif = {
images: {
fixed_height: {
mp4: 'mp4-data',
webp: 'data',
width: '100',
height: '100',
},
Expand All @@ -45,7 +45,7 @@ describe('GifImageComponent', () => {
const change = new SimpleChange(undefined, component.gif, true);
component.ngOnChanges({ gif: change });

expect(component.src).toBe('mp4-data');
expect(component.src).toBe('data');
expect(component.width).toBe(100);
expect(component.height).toBe(100);
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export class GifImageComponent implements OnChanges {
}

private setImageProperties(imageData: Image): void {
this.src = imageData.mp4;
this.src = imageData.webp;
this.width = parseInt(imageData.width, 10) || undefined;
this.height = parseInt(imageData.height, 10) || undefined;
}
Expand Down

1 comment on commit bf371b6

@vercel
Copy link

@vercel vercel bot commented on bf371b6 Sep 18, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.