Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
.then(() => {
expect(MusicControl.updatePlayback).toHaveBeenCalledTimes(1);
expect(MusicControl.updatePlayback).toHaveBeenCalledWith({ state: MusicControl.STATE_PAUSED, elapsedTime });
});
});
.then(() => {
expect(MusicControl.updatePlayback).toHaveBeenCalledTimes(1);
expect(MusicControl.updatePlayback).toHaveBeenCalledWith({ state: MusicControl.STATE_PAUSED, elapsedTime });
});
});
() => {
if (this.state.paused) {
MusicControl.updatePlayback({
state: MusicControl.STATE_PAUSED
});
} else {
MusicControl.updatePlayback({
state: MusicControl.STATE_PLAYING
});
}
}
);
stop(): void {
if (this._trackPlaying) {
this._trackPlaying.stop();
this._releaseTrack();
if (this.enableSetNowPlaying) {
this._updatePlayback(MusicControl.STATE_PAUSED);
}
if (this._onStop) {
this._onStop();
}
}
}
togglePlay(status) {
this.props.setPlaying(status);
MusicControl.updatePlayback({
state: status? MusicControl.STATE_PLAYING: MusicControl.STATE_PAUSED,
elapsedTime: this.state.currentTime
})
}