The HTML media element to act upon
The fade-in duration in [seconds]. Default is 1000 (1 second)
The fade-out duration in [seconds]. Default is 500 (500 milliseconds)
Whether to apply the seek offset before fade-in operations, to compensate the fading duration. (Default: true)
The overall volume of the output. Can be used to control the output volume in addition to fadings. (Default: 1, representing full scale)
Private _anyThe any soloed state
Private _mutedThe muted state
Private _soloedThe soloed state
Whether to apply a seek offset before fade-in operations, to compensate the fading duration.
The audio element instance to act upon
The fade-in duration in [milliseconds] (zero means no fading)
The fade-out duration in [milliseconds] (zero means no fading)
Fading is generally enabled by default, but may get disabled permanently or on some events
Private masterThe master volume level
The master volume emulates an expected volume that is output from the fader, without any mute/solo/fading taken into account.
Emits a changed fading state.
kind of fading operation that is currently ongoing
Emits a changed muted state.
the changed muted state
Emits a changed soloed state.
the changed soloed state
Emits a changed master volume state.
the changed master volume
The token for the currently running fade operation.
Allows an ongoing fading operation to determine whether it has been superseded by a subsequent operation. This allows the first operation to reject the promise and abandon the fade operation in favor of the later one.
Static Private audioThe maximum audio volume level
Static Private audioThe minimum audio volume level
-90dbFS Amplitude
Static Private cancelStatic Private stepThe fading step duration, in [milliseconds]. This is set to a fixed value, as a tradeoff between call frequency and smoothness
This should be set to a value that produces small volume changes, that are barely audible
Gets the overall solo state in a multitrack context.
When any is soloed, but not this track, this is effectively muted.
Sets the overall solo state in a multitrack context.
When any is soloed, but not this track, this is effectively muted.
Private audioInternally gets the media element volume, with the level limited to the allowed audio volume range.
Internally sets the media element volume, with the level limited to the allowed audio volume range.
Gets the effective fade-in duration, in [milliseconds], taking into account whether fade-in is enabled.
Gets the effective fade-out duration, in [milliseconds], taking into account whether fade-out is enabled.
Gets the fading state, which is true for any kind of fading.
Gets the muted state.
Sets the muted state.
Gets the soloed state.
Sets the soloed state.
Applies the pre-roll:
The fade-in duration.
At the beginning of a resource, the offset is cut off at zero.
Private fadeReturns a fade-in promise for the currently playing track
Optional immediate: booleanWhen set to true, the fade operation is done with duration zero.
The sound is faded to the master volume audio level. A pre-fade offset is applied, when configured An actual fade operation is only started when
Returns a fade-out promise for the currently playing track
Optional immediate: booleanWhen set to true, the fade operation is done with duration zero.
The sound is faded to the minimum audio level. An actual fade operation is only started when
Private getGets the master audio volume, with the possible muted and soloed state (but not a possibly ongoing fade-in/fade-out) observed
A value between 0 (zero) and 1 (representing full scale), while observing the muted state.
A muted state returns the min volume. A non-soloed state, when any is soloed, returns the min volume.
Private limitedSets the volume to the initial value.
This method is to be used at creation time or for a hard reset. When a non-zero fading duration is set, this is the minimum value (prepare for the fade-in). When a zero fading duration is set, this is the maximum value (effectively remove any fade). Does not affect the muted state.
Sets up emission of intentional volume changes on the HTML media element.
This allows a user to control the volume direcly from the HTML audio element controls, which are usually coupled with external input devices like Bluetooth headsets. NOTE: Only changes that are not caused by internal automation are considered.
Updates the current settings.
The fade-in duration. Default is 1000 (1 second)
The fade-out duration. Default is 500 (500 milliseconds)
Whether to apply an additional seek offset before fade-in operations, to compensate the fading duration. (Default: true)
The settings will be used for the next fade. However, when the new duration is zero (no fade), the cancel operation is immediately called, resetting the volume to the initial value for this case.
Implements an audio fader for an HTML media element instance. This fader supports two concepts:
Remarks
Currently only supports a linear audio fade, with a constant gradient, only determined by the predefined durations for a full-scale fade. Video content, in case of an HTMLVideoElement, is not changed in any way.