UseCreateAutoDisposedViewModel for audio player (#31503)
* refactor: useCreateAutoDisposedViewModel for audio player * Update src/viewmodels/audio/AudioPlayerViewModel.ts Co-authored-by: Michael Telatynski <7t3chguy@gmail.com> --------- Co-authored-by: Michael Telatynski <7t3chguy@gmail.com>
This commit is contained in:
@@ -141,4 +141,13 @@ export class AudioPlayerViewModel
|
||||
public onSeekbarChange = async (ev: ChangeEvent<HTMLInputElement>): Promise<void> => {
|
||||
await this.props.playback.skipTo((Number(ev.target.value) / 100) * this.props.playback.durationSeconds);
|
||||
};
|
||||
|
||||
/**
|
||||
* Updates the properties of the view model and recomputes the snapshot.
|
||||
* @param newProps
|
||||
*/
|
||||
public setProps(newProps: Partial<Props>): void {
|
||||
this.props = { ...this.props, ...newProps };
|
||||
this.setSnapshot();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user