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_PLAYING, elapsedTime });
});
});
return promise.then(() => {
if (this._trackPlaying) {
this._trackPlaying.play(success => {
this.playNext();
});
this.isPlaying = true;
if (this.enableSetNowPlaying) {
this._updatePlayback(MusicControl.STATE_PLAYING);
}
if (this._onPlay) {
this._onPlay(track);
}
return Promise.resolve();
} else {
return Promise.reject();
}
});
}
() => {
MusicControl.updatePlayback({
state: MusicControl.STATE_PLAYING,
elapsedTime: currentTime
});
}
);
artist: "Alkitab Suara",
duration: this.state.streamDuration,
color: 0xfffffff
});
MusicControl.on("play", () => {
this.setState({ paused: false });
});
MusicControl.on("pause", () => {
this.setState({ paused: true });
});
MusicControl.on("nextTrack", () => {});
MusicControl.on("previousTrack", () => {});
MusicControl.updatePlayback({
state: MusicControl.STATE_PLAYING
});
}
);
goBackward(){
if(this.state.currentTime < 3 && this.props.songIndex !== 0 ) {
this.props.setPlayingSong(this.props.songIndex - 1);
} else {
this.refs.audio.seek(0);
MusicControl.updatePlayback({
state: MusicControl.STATE_PLAYING,
elapsedTime: 0
})
}
}