-
Notifications
You must be signed in to change notification settings - Fork 185
Player Class Reference
The AV.Player
class plays back audio data from various sources as decoded by the AV.Asset class. In addition, it handles common audio filters like panning and volume adjustment, and interfacing with an AV.AudioDevice to keep track of the playback time.
Creates a AV.Player
with the specified AV.Asset.
Creates a AV.Player
with an AV.Asset pointing to the specified url.
Creates an AV.Player
with a AV.Asset pointing to the specified File.
Creates an AV.Player
with an AV.BufferSource
pointing to the specified buffer.
buffer
can be one of the following:
- an AV.Buffer,
- an
ArrayBuffer
, - a typed array,
- a Node
Buffer
, or - even an AV.BufferList for decoding sequences of buffers.
The percentage of the audio file that has been buffered by the source
.
The duration of the audio file in milliseconds.
Whether the file is currently playing.
The current playback time in milliseconds.
The volume of the player as a percentage from 0 to 100. Change this property to adjust the output volume.
The stereo pan of the player as a percentage from 0 to 100.
The format object describing the audio format as returned by the demuxer
.
An object containing any metadata embedded in the audio file.
The backing AV.Asset for the player.
An array of AV.Filters that should be applied to the output audio. Initially contains a AV.VolumeFilter
and a AV.PanFilter
.
Starts loading the asset
without playing it.
Starts playback for the asset
. If it hasn't been preloaded yet, preload will be called for you.
Pauses playback for the asset
such that calling play will start playback where it left off.
If the player is paused, start playback. If the player is already playing, pause playback.
Stops playback of the asset
in a destructive way.
Emitted while the audio file is being loaded with a percentage between 0 and 100 representing the amount of the file that has been read so far.
Emitted when the demuxer has decoded enough information to determine basic format information about the audio file.
Emitted when the duration of the audio file has been parsed.
Emitted when any embedded metadata is decoded.
Emitted when the audio file is ready to play.
Emitted while the audio file is playing with updates to the current playback time in milliseconds.
Emitted when the an error is encountered in the decoding process. Whenever an error is encountered, the decoding process is also stopped automatically.
Emitted when the audio file ends.