@ki1r0y/signed-cloud-server
Version:
Basic cloud storage in which contents are cryptographically signed, using distributed-storage as a co-dependency.
23 lines (18 loc) • 357 B
JavaScript
class Player {
play(song) {
this.currentlyPlayingSong = song;
this.isPlaying = true;
}
pause() {
this.isPlaying = false;
}
resume() {
if (this.isPlaying) {
throw new Error('song is already playing');
}
this.isPlaying = true;
}
makeFavorite() {
this.currentlyPlayingSong.persistFavoriteStatus(true);
}
}