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 |
Copy file name to clipboardExpand all lines: src/components/AudioPlayer.tsx
+46-18Lines changed: 46 additions & 18 deletions
Original file line number
Diff line number
Diff line change
@@ -10,11 +10,39 @@ 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
+
44
+
interfaceAudioPlayerProps{
45
+
18
46
/**
19
47
* Displays a minimal version of the audio player, with only the play/pause button, track bar and timestamp. Defaults to `false`
20
48
*/
@@ -31,7 +59,6 @@ interface AudioPlayerProps {
31
59
* Gap between each individual bar in the visualization. Defaults to `1`
32
60
*/
33
61
gap?: number;
34
-
35
62
/**
36
63
* Represents whether the audio visualization (waveform) should be displayed. Defaults to `true`
37
64
*/
@@ -52,7 +79,6 @@ interface AudioPlayerProps {
52
79
* Bar color for the bars that have been played
53
80
*/
54
81
barPlayedColor?: string;
55
-
56
82
/**
57
83
* Represents whether the skip forward/backward options should be displayed. Defaults to `true`. Not applicable when `minimal` is set to `true`
58
84
*/
@@ -61,14 +87,6 @@ interface AudioPlayerProps {
61
87
* The number of seconds to skip forward/backward. Defaults to `5`
62
88
*/
63
89
skipDuration?: number;
64
-
/**
65
-
* Initial volume for the audio, minimum being `0`, maximum being `1`. Defaults to `0.75`
66
-
*/
67
-
initialVolume?: number;
68
-
/**
69
-
* Setting this to `true` will keep playing the audio in a loop. Defaults to `false`
70
-
*/
71
-
loop?: boolean;
72
90
/**
73
91
* Represents whether to show the loop options. Defaults to `true`
0 commit comments