Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to achieve track fine seeking/scrubbing on Progress component #84

Open
ridhwaans opened this issue Apr 15, 2018 · 1 comment
Open
Labels

Comments

@ridhwaans
Copy link

In the PlaylistSoundPlayer.js demo on https://labs.voronianski.com/react-soundplayer/, how do you achieve fast fowarding or rewinding the track while clicking on the Progress bar? I have a readstream in the back like so but I am unable to reproduce the same behaviour

function(req, res) {
  const path = <path_to_track_file>
  const stat = fs.statSync(path)
  const head = {
      'Content-Type': 'audio/mpeg',
      'Content-Length': stat.size
  }
  res.writeHead(200, head);
  fs.createReadStream(path).pipe(res);
});
@voronianski
Copy link
Member

@ridhwaans here's where seekiing behavior is happening -

https://github.com/kosmetism/react-soundplayer/blob/master/src/components/Progress.js#L12

You need to check then instance of HTML audio element and figure out is it missing these fields and why. Reference on the fields and their descriptions are available here - https://developer.mozilla.org/en-US/docs/Web/API/HTMLMediaElement.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants