Skip to content

Commit

Permalink
fix: stop media from playing when scene is reset
Browse files Browse the repository at this point in the history
  • Loading branch information
justusmattern27 committed Mar 13, 2024
1 parent 84a809c commit 31f2ad8
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions packages/2d/src/lib/components/Media.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,12 @@ export abstract class Media extends Rect {
return this.mediaElement().duration;
}

public override dispose() {
this.pause();
this.remove();
super.dispose();
}

@computed()
public override completion(): number {
return this.clampTime(this.time()) / this.getDuration();
Expand Down

0 comments on commit 31f2ad8

Please sign in to comment.