Skip to content

Pause then Play restarting #104

Description

@beamercola

I'm having an issue when i click to pause the player, then click again, it starts over from 0:00 - is this the intended behavior? Is there a way to resume from current position?

const Player = withCustomAudio(props => {
  const { soundCloudAudio, playing, track, currentTime } = props;

  const play = () => {
    if (playing) {
      soundCloudAudio.pause();
    } else {
      soundCloudAudio.play();
    }
  }

  return (
    <div className="flex flex-col rounded-lg border border-black overflow-hidden bg-white shadow">
      <img className="w-96 h-96 border-b border-black cursor-pointer" src={track.cover} onClick={() => play()} alt={track.title} />

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions