Skip to content

Question: How to add more features... #2

Description

@rchrdnsh

Hi Upmostly,

I emailed you earlier this week, but figured it would be easier to just create an issue to ask you a question, so I hope that's ok :-)

I'm curious how to add more features to this example. I have been trying to teach myself but I'm a bit lost. I'm currently trying to add time elapsed counter, a progress bar that I can jump around in the song with, and a total duration number on the other end. I would also like to add a volume fader as well, among other things.

As far as I can tell, you are using the HTML Audio Element, which inherits from the HTML Media Element, is this correct? If that is the case, then I'm trying to do stuff like this, like get the current time of the current playing track:

 // Get the current time of the currently playing track
function currentTime() {
  if (state.isPlaying) {
    state.audioPlayer.currentTime()
  }
}

...but it doesn't seem to be working. If there is any advice or pointers that you can give in regards to interfacing with Audio(), React, and the Context API? I am all ears :-)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions