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 can I start playing a media at a given start position? #82

Open
cfoch opened this issue Jun 2, 2020 · 1 comment
Open

How can I start playing a media at a given start position? #82

cfoch opened this issue Jun 2, 2020 · 1 comment

Comments

@cfoch
Copy link

cfoch commented Jun 2, 2020

Or even better... at a given state (volume, rate, paused/playing, currentTime, ...)

@jnarwold
Copy link

jnarwold commented Jul 10, 2020

It looks as though there is a defaultCurrentTime prop on the <Player> component that allows for a number (seconds) to be passed in as the initial start time. Fair warning, it doesn't seem to play well if you're switching between audio files. For that, I had to pass in an onReady function and do something like this:

const onPlayerReady = ({seekTo}) => {
  if (id !== lastLoadedId) {
    seekTo(40) //initial start time here

    setLastLoadedId(id)
  }
}

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

No branches or pull requests

2 participants