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
|**`src`**| The address or URL of the a audio resource that is to be considered | N/A | No |
53
+
|**`volume`**| Initial volume level for the audio, minimum being `0`, maximum being `1`|`0.75`| Yes |
54
+
|**`loop`**| Sets a flag to specify whether playback should restart after it completes |`false`| Yes |
55
+
|**`muted`**| Sets a flag that indicates whether the audio is muted |`false`| Yes |
56
+
|**`autoplay`**| Sets a value that indicates whether to start playing the media automatically |`false`| Yes |
57
+
|**`crossOrigin`**| The CORS setting for this media element. [MDN Reference](https://developer.mozilla.org/en-US/docs/Web/API/HTMLMediaElement/crossOrigin)|`null`| Yes |
58
+
|**`autoplay`**| Sets a value indicating what data should be preloaded, if any. Allowed values `""`, `"none"`, `"metadata"`, `"auto"`|`""`| Yes |
59
+
|**`playbackRate`**| Sets the rate at which media is being played back |`1.0`| Yes |
60
+
---
61
+
<br>
49
62
63
+
## Audio element events
64
+
#### `AudioPlayer` supports all the events for `HTMLMediaElement` ([MDN Reference](https://developer.mozilla.org/en-US/docs/Web/API/HTMLMediaElement#events)). All of the events listed in the MDN docs can be passed as a prop to the `AudioPlayer`
@@ -10,11 +10,67 @@ import repeatSVG from "../icons/repeat.svg";
10
10
importrepeatOneSVGfrom"../icons/repeat-one.svg";
11
11
importTimerfrom"./Timer";
12
12
13
-
interfaceAudioPlayerProps{
13
+
interfaceAudioElementNativeProps{
14
14
/**
15
-
* Source for the audio file that needs to be played
15
+
* The address or URL of the a audio resource that is to be considered.
16
16
*/
17
17
src: string;
18
+
/**
19
+
* Sets a flag to specify whether playback should restart after it completes. Defaults to `false`
20
+
*/
21
+
loop?: boolean;
22
+
/**
23
+
* Initial volume level for the audio, minimum being `0`, maximum being `1`. Defaults to `0.75`
24
+
*/
25
+
volume?: number;
26
+
/**
27
+
* Sets a flag that indicates whether the audio is muted. Defaults to `false`
28
+
*/
29
+
muted?: boolean;
30
+
/**
31
+
* Sets a value that indicates whether to start playing the media automatically. Defaults to `false`
32
+
*/
33
+
autoplay?: boolean;
34
+
/**
35
+
* The CORS setting for this media element. {@link https://developer.mozilla.org/en-US/docs/Web/API/HTMLMediaElement/crossOrigin MDN Reference}. Defaults to `null`
36
+
*/
37
+
crossOrigin?: string;
38
+
/**
39
+
* Sets a value indicating what data should be preloaded, if any. Defaults to empty string
40
+
*/
41
+
preload?: ""|"none"|"metadata"|"auto";
42
+
/**
43
+
* Sets the rate at which media is being played back. Defaults to `1.0`
0 commit comments