Skip to content

Commit

Permalink
fix(cdk): Media throws SSR error `TypeError: this.el.pause is not a…
Browse files Browse the repository at this point in the history
… function` (#7115)
  • Loading branch information
nsbarsukov authored Mar 28, 2024
1 parent 7af1491 commit 69bfaf8
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions projects/cdk/directives/media/media.directive.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,19 +47,19 @@ export class TuiMediaDirective {
@Input()
public set paused(paused: boolean) {
if (paused) {
this.el.pause();
this.el.pause?.();
} else {
void this.el.play();
void this.el.play?.();
this.updatePlaybackRate(this.playbackRate);
}
}

public get currentTime(): number {
return this.el.currentTime;
return this.el.currentTime ?? 0;
}

public get paused(): boolean {
return this.el.paused;
return Boolean(this.el.paused);
}

// @bad TODO: Make sure no other events can affect this like network issues etc.
Expand Down

0 comments on commit 69bfaf8

Please sign in to comment.