Skip to content

AudioPlayer #2

Description

@kareniel

"A test suite and interface you can use to implement a hyperaudio compatible audio player."

"This would also serve as a place to design a playback API that can be swapped out with native ones in the future."

"A random-audio-player instance is a common interface for an audio player abstraction, that provides a core api."

I extracted what I understand to be the public api of the AudioPlayer class I found in Hyperamp.
This is basically a wrapper class around the node from a given audio element, right?

🔀 abstract-audio-player

usage

audioPlayer = AudioPlayer(audioNode, globalState)

properties

  • volume (from globalState.volume)
  • muted (from globalState.volume)
  • src (from globalState.audioLibray.currentTrack.filepath)
  • seeking
  • timeupdate
  • audio (audioNode)
    • volume
    • muted
    • src
    • currentTime

methods

  • seekDebounce
  • load
  • play
  • pause
  • volume
  • mute
  • unmute
  • seek

+ nanobus methods:

  • bus.emit(eventName, [data])
  • bus.on(eventName, listener([data]))
  • bus.prependListener(eventName, listener([data]))
  • bus.once(eventName, listener([data]))
  • bus.prependOnceListener(eventName, listener([data]))
  • bus.removeListener(eventName, listener)
  • bus.listeners(eventName)

events

  • ended
  • timeupdate
  • initialized
  • loading
  • playing
  • paused
  • volume
  • muted
  • unmuted
  • seek

See also:

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