You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
An optional string containing the URL of an audio file to be associated with the new audio element.
33
+
> -__param.volume?__: _number_
34
+
A double indicating the audio volume, from 0.0 (silent) to 1.0 (loudest).
35
+
> -__param.loop?__: _boolean_
36
+
A boolean that reflects the loop HTML attribute, which indicates whether the media element should start over when it reaches the end.
37
+
> -__param.defaultMuted?__: _boolean_
38
+
A boolean that reflects the muted HTML attribute, which indicates whether the media element's audio output should be muted by default.
39
+
> -__param.autoPlay?__: _boolean_
40
+
A boolean value that reflects the autoplay HTML attribute, indicating whether playback should automatically begin as soon as enough media is available to do so without interruption.
41
+
> -__param.playbackRate?__: _number_
42
+
A double that indicates the rate at which the media is being played back.
43
+
> -__param.onError] ?__: _OnErrorEventHandler_
44
+
>
45
+
46
+
> ### Returns
47
+
>
48
+
> __result__: _UseAudioResult_
49
+
> Object with these properties:
50
+
> -__state__: object with current audio properties:
51
+
> - _status_: value between __"unavailable"__ __"ready"__ __"playing"__ __"pause"__ indicating current audio status.
52
+
> - _volume_: current audio volume.
53
+
> - _playbackRate_: current audio playbackRate.
54
+
> -__setAudio__: function to set audio.
55
+
> -__setPlaybackRate__: function to set audio playbackRate.
* @param {string} [param.url] - An optional string containing the URL of an audio file to be associated with the new audio element.
9
+
* @param {number} [param.volume] - A double indicating the audio volume, from 0.0 (silent) to 1.0 (loudest).
10
+
* @param {boolean} [param.loop] - A boolean that reflects the loop HTML attribute, which indicates whether the media element should start over when it reaches the end.
11
+
* @param {boolean} [param.defaultMuted] - A boolean that reflects the muted HTML attribute, which indicates whether the media element's audio output should be muted by default.
12
+
* @param {number} [param.playbackRate] - A double that indicates the rate at which the media is being played back.
13
+
* @param {OnErrorEventHandler} [param.onError] -
14
+
* @returns {UseAudioResult} result
15
+
* Object with these properties:
16
+
* - __state__: object with current audio properties:
17
+
* - _status_: value between __"unavailable"__ __"ready"__ __"playing"__ __"pause"__ indicating current audio status.
18
+
* - _volume_: current audio volume.
19
+
* - _playbackRate_: current audio playbackRate.
20
+
* - __setAudio__: function to set audio.
21
+
* - __setPlaybackRate__: function to set audio playbackRate.
0 commit comments