@capgo/capacitor-native-audio 8.4.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CapgoCapacitorNativeAudio.podspec +16 -0
- package/LICENSE +373 -0
- package/Package.swift +31 -0
- package/README.md +1229 -0
- package/android/build.gradle +89 -0
- package/android/src/main/AndroidManifest.xml +3 -0
- package/android/src/main/java/ee/forgr/audio/AudioAsset.java +611 -0
- package/android/src/main/java/ee/forgr/audio/AudioCompletionListener.java +5 -0
- package/android/src/main/java/ee/forgr/audio/AudioDispatcher.java +208 -0
- package/android/src/main/java/ee/forgr/audio/Constant.java +36 -0
- package/android/src/main/java/ee/forgr/audio/HlsAvailabilityChecker.java +84 -0
- package/android/src/main/java/ee/forgr/audio/Logger.java +55 -0
- package/android/src/main/java/ee/forgr/audio/NativeAudio.java +2022 -0
- package/android/src/main/java/ee/forgr/audio/RemoteAudioAsset.java +886 -0
- package/android/src/main/java/ee/forgr/audio/StreamAudioAsset.java +708 -0
- package/android/src/main/res/values/colors.xml +3 -0
- package/android/src/main/res/values/strings.xml +3 -0
- package/android/src/main/res/values/styles.xml +3 -0
- package/dist/docs.json +1470 -0
- package/dist/esm/audio-asset.d.ts +4 -0
- package/dist/esm/audio-asset.js +6 -0
- package/dist/esm/audio-asset.js.map +1 -0
- package/dist/esm/definitions.d.ts +597 -0
- package/dist/esm/definitions.js +2 -0
- package/dist/esm/definitions.js.map +1 -0
- package/dist/esm/index.d.ts +4 -0
- package/dist/esm/index.js +7 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/web.d.ts +82 -0
- package/dist/esm/web.js +553 -0
- package/dist/esm/web.js.map +1 -0
- package/dist/plugin.cjs.js +571 -0
- package/dist/plugin.cjs.js.map +1 -0
- package/dist/plugin.js +574 -0
- package/dist/plugin.js.map +1 -0
- package/ios/Sources/NativeAudioPlugin/AudioAsset+Fade.swift +157 -0
- package/ios/Sources/NativeAudioPlugin/AudioAsset.swift +403 -0
- package/ios/Sources/NativeAudioPlugin/Constant.swift +52 -0
- package/ios/Sources/NativeAudioPlugin/Logger.swift +43 -0
- package/ios/Sources/NativeAudioPlugin/Plugin.swift +1786 -0
- package/ios/Sources/NativeAudioPlugin/RemoteAudioAsset+Fade.swift +152 -0
- package/ios/Sources/NativeAudioPlugin/RemoteAudioAsset.swift +405 -0
- package/ios/Tests/NativeAudioPluginTests/PluginTests.swift +648 -0
- package/ios/Tests/README.md +39 -0
- package/package.json +101 -0
- package/scripts/configure-dependencies.js +251 -0
package/dist/docs.json
ADDED
|
@@ -0,0 +1,1470 @@
|
|
|
1
|
+
{
|
|
2
|
+
"api": {
|
|
3
|
+
"name": "NativeAudio",
|
|
4
|
+
"slug": "nativeaudio",
|
|
5
|
+
"docs": "",
|
|
6
|
+
"tags": [],
|
|
7
|
+
"methods": [
|
|
8
|
+
{
|
|
9
|
+
"name": "configure",
|
|
10
|
+
"signature": "(options: ConfigureOptions) => Promise<void>",
|
|
11
|
+
"parameters": [
|
|
12
|
+
{
|
|
13
|
+
"name": "options",
|
|
14
|
+
"docs": "",
|
|
15
|
+
"type": "ConfigureOptions"
|
|
16
|
+
}
|
|
17
|
+
],
|
|
18
|
+
"returns": "Promise<void>",
|
|
19
|
+
"tags": [
|
|
20
|
+
{
|
|
21
|
+
"name": "since",
|
|
22
|
+
"text": "5.0.0"
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
"name": "param",
|
|
26
|
+
"text": "option"
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
"name": "link",
|
|
30
|
+
"text": "ConfigureOptions}"
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
"name": "returns"
|
|
34
|
+
}
|
|
35
|
+
],
|
|
36
|
+
"docs": "Configure the audio player",
|
|
37
|
+
"complexTypes": [
|
|
38
|
+
"ConfigureOptions"
|
|
39
|
+
],
|
|
40
|
+
"slug": "configure"
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
"name": "preload",
|
|
44
|
+
"signature": "(options: PreloadOptions) => Promise<void>",
|
|
45
|
+
"parameters": [
|
|
46
|
+
{
|
|
47
|
+
"name": "options",
|
|
48
|
+
"docs": "",
|
|
49
|
+
"type": "PreloadOptions"
|
|
50
|
+
}
|
|
51
|
+
],
|
|
52
|
+
"returns": "Promise<void>",
|
|
53
|
+
"tags": [
|
|
54
|
+
{
|
|
55
|
+
"name": "since",
|
|
56
|
+
"text": "5.0.0"
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
"name": "param",
|
|
60
|
+
"text": "option"
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
"name": "link",
|
|
64
|
+
"text": "PreloadOptions}"
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
"name": "returns"
|
|
68
|
+
}
|
|
69
|
+
],
|
|
70
|
+
"docs": "Load an audio file",
|
|
71
|
+
"complexTypes": [
|
|
72
|
+
"PreloadOptions"
|
|
73
|
+
],
|
|
74
|
+
"slug": "preload"
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
"name": "playOnce",
|
|
78
|
+
"signature": "(options: PlayOnceOptions) => Promise<PlayOnceResult>",
|
|
79
|
+
"parameters": [
|
|
80
|
+
{
|
|
81
|
+
"name": "options",
|
|
82
|
+
"docs": "",
|
|
83
|
+
"type": "PlayOnceOptions"
|
|
84
|
+
}
|
|
85
|
+
],
|
|
86
|
+
"returns": "Promise<PlayOnceResult>",
|
|
87
|
+
"tags": [
|
|
88
|
+
{
|
|
89
|
+
"name": "example",
|
|
90
|
+
"text": "```typescript\n// Simple one-shot playback\nawait NativeAudio.playOnce({ assetPath: 'audio/notification.mp3' });\n\n// Play and delete the file after completion\nawait NativeAudio.playOnce({\n assetPath: 'file:///path/to/temp/audio.mp3',\n isUrl: true,\n deleteAfterPlay: true\n});\n\n// Get the assetId to control playback\nconst { assetId } = await NativeAudio.playOnce({\n assetPath: 'audio/long-track.mp3',\n autoPlay: true\n});\n// Later, you can stop it manually if needed\nawait NativeAudio.stop({ assetId });\n```"
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
"name": "since",
|
|
94
|
+
"text": "7.11.0"
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
"name": "param",
|
|
98
|
+
"text": "options"
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
"name": "link",
|
|
102
|
+
"text": "PlayOnceOptions}"
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
"name": "returns",
|
|
106
|
+
"text": "Object containing the generated assetId"
|
|
107
|
+
}
|
|
108
|
+
],
|
|
109
|
+
"docs": "Play an audio file once with automatic cleanup\n\nMethod designed for simple, single-shot audio playback,\nsuch as notification sounds, UI feedback, or other short audio clips\nthat don't require manual state management.\n\n**Key Features:**\n- **Fire-and-forget**: No need to manually preload, play, stop, or unload\n- **Auto-cleanup**: Asset is automatically unloaded after playback completes\n- **Optional file deletion**: Can delete local files after playback (useful for temp files)\n- **Returns assetId**: Can still control playback if needed (pause, stop, etc.)\n\n**Use Cases:**\n- Notification sounds\n- UI sound effects (button clicks, alerts)\n- Short audio clips that play once\n- Temporary audio files that should be cleaned up\n\n**Comparison with regular play():**\n- `play()`: Requires manual preload, play, and unload steps\n- `playOnce()`: Handles everything automatically with a single call",
|
|
110
|
+
"complexTypes": [
|
|
111
|
+
"PlayOnceResult",
|
|
112
|
+
"PlayOnceOptions"
|
|
113
|
+
],
|
|
114
|
+
"slug": "playonce"
|
|
115
|
+
},
|
|
116
|
+
{
|
|
117
|
+
"name": "isPreloaded",
|
|
118
|
+
"signature": "(options: PreloadOptions) => Promise<{ found: boolean; }>",
|
|
119
|
+
"parameters": [
|
|
120
|
+
{
|
|
121
|
+
"name": "options",
|
|
122
|
+
"docs": "",
|
|
123
|
+
"type": "PreloadOptions"
|
|
124
|
+
}
|
|
125
|
+
],
|
|
126
|
+
"returns": "Promise<{ found: boolean; }>",
|
|
127
|
+
"tags": [
|
|
128
|
+
{
|
|
129
|
+
"name": "since",
|
|
130
|
+
"text": "6.1.0"
|
|
131
|
+
},
|
|
132
|
+
{
|
|
133
|
+
"name": "param",
|
|
134
|
+
"text": "option"
|
|
135
|
+
},
|
|
136
|
+
{
|
|
137
|
+
"name": "link",
|
|
138
|
+
"text": "Assets}"
|
|
139
|
+
},
|
|
140
|
+
{
|
|
141
|
+
"name": "returns"
|
|
142
|
+
}
|
|
143
|
+
],
|
|
144
|
+
"docs": "Check if an audio file is preloaded",
|
|
145
|
+
"complexTypes": [
|
|
146
|
+
"PreloadOptions"
|
|
147
|
+
],
|
|
148
|
+
"slug": "ispreloaded"
|
|
149
|
+
},
|
|
150
|
+
{
|
|
151
|
+
"name": "play",
|
|
152
|
+
"signature": "(options: AssetPlayOptions) => Promise<void>",
|
|
153
|
+
"parameters": [
|
|
154
|
+
{
|
|
155
|
+
"name": "options",
|
|
156
|
+
"docs": "",
|
|
157
|
+
"type": "AssetPlayOptions"
|
|
158
|
+
}
|
|
159
|
+
],
|
|
160
|
+
"returns": "Promise<void>",
|
|
161
|
+
"tags": [
|
|
162
|
+
{
|
|
163
|
+
"name": "since",
|
|
164
|
+
"text": "5.0.0"
|
|
165
|
+
},
|
|
166
|
+
{
|
|
167
|
+
"name": "param",
|
|
168
|
+
"text": "option"
|
|
169
|
+
},
|
|
170
|
+
{
|
|
171
|
+
"name": "link",
|
|
172
|
+
"text": "AssetPlayOptions}"
|
|
173
|
+
},
|
|
174
|
+
{
|
|
175
|
+
"name": "returns"
|
|
176
|
+
}
|
|
177
|
+
],
|
|
178
|
+
"docs": "Play an audio file",
|
|
179
|
+
"complexTypes": [
|
|
180
|
+
"AssetPlayOptions"
|
|
181
|
+
],
|
|
182
|
+
"slug": "play"
|
|
183
|
+
},
|
|
184
|
+
{
|
|
185
|
+
"name": "pause",
|
|
186
|
+
"signature": "(options: AssetPauseOptions) => Promise<void>",
|
|
187
|
+
"parameters": [
|
|
188
|
+
{
|
|
189
|
+
"name": "options",
|
|
190
|
+
"docs": "",
|
|
191
|
+
"type": "AssetPauseOptions"
|
|
192
|
+
}
|
|
193
|
+
],
|
|
194
|
+
"returns": "Promise<void>",
|
|
195
|
+
"tags": [
|
|
196
|
+
{
|
|
197
|
+
"name": "since",
|
|
198
|
+
"text": "5.0.0"
|
|
199
|
+
},
|
|
200
|
+
{
|
|
201
|
+
"name": "param",
|
|
202
|
+
"text": "option"
|
|
203
|
+
},
|
|
204
|
+
{
|
|
205
|
+
"name": "link",
|
|
206
|
+
"text": "AssetPauseOptions}"
|
|
207
|
+
},
|
|
208
|
+
{
|
|
209
|
+
"name": "returns"
|
|
210
|
+
}
|
|
211
|
+
],
|
|
212
|
+
"docs": "Pause an audio file",
|
|
213
|
+
"complexTypes": [
|
|
214
|
+
"AssetPauseOptions"
|
|
215
|
+
],
|
|
216
|
+
"slug": "pause"
|
|
217
|
+
},
|
|
218
|
+
{
|
|
219
|
+
"name": "resume",
|
|
220
|
+
"signature": "(options: AssetResumeOptions) => Promise<void>",
|
|
221
|
+
"parameters": [
|
|
222
|
+
{
|
|
223
|
+
"name": "options",
|
|
224
|
+
"docs": "",
|
|
225
|
+
"type": "AssetResumeOptions"
|
|
226
|
+
}
|
|
227
|
+
],
|
|
228
|
+
"returns": "Promise<void>",
|
|
229
|
+
"tags": [
|
|
230
|
+
{
|
|
231
|
+
"name": "since",
|
|
232
|
+
"text": "5.0.0"
|
|
233
|
+
},
|
|
234
|
+
{
|
|
235
|
+
"name": "param",
|
|
236
|
+
"text": "option"
|
|
237
|
+
},
|
|
238
|
+
{
|
|
239
|
+
"name": "link",
|
|
240
|
+
"text": "AssetResumeOptions}"
|
|
241
|
+
},
|
|
242
|
+
{
|
|
243
|
+
"name": "returns"
|
|
244
|
+
}
|
|
245
|
+
],
|
|
246
|
+
"docs": "Resume an audio file",
|
|
247
|
+
"complexTypes": [
|
|
248
|
+
"AssetResumeOptions"
|
|
249
|
+
],
|
|
250
|
+
"slug": "resume"
|
|
251
|
+
},
|
|
252
|
+
{
|
|
253
|
+
"name": "loop",
|
|
254
|
+
"signature": "(options: Assets) => Promise<void>",
|
|
255
|
+
"parameters": [
|
|
256
|
+
{
|
|
257
|
+
"name": "options",
|
|
258
|
+
"docs": "",
|
|
259
|
+
"type": "Assets"
|
|
260
|
+
}
|
|
261
|
+
],
|
|
262
|
+
"returns": "Promise<void>",
|
|
263
|
+
"tags": [
|
|
264
|
+
{
|
|
265
|
+
"name": "since",
|
|
266
|
+
"text": "5.0.0"
|
|
267
|
+
},
|
|
268
|
+
{
|
|
269
|
+
"name": "param",
|
|
270
|
+
"text": "option"
|
|
271
|
+
},
|
|
272
|
+
{
|
|
273
|
+
"name": "link",
|
|
274
|
+
"text": "Assets}"
|
|
275
|
+
},
|
|
276
|
+
{
|
|
277
|
+
"name": "returns"
|
|
278
|
+
}
|
|
279
|
+
],
|
|
280
|
+
"docs": "Stop an audio file",
|
|
281
|
+
"complexTypes": [
|
|
282
|
+
"Assets"
|
|
283
|
+
],
|
|
284
|
+
"slug": "loop"
|
|
285
|
+
},
|
|
286
|
+
{
|
|
287
|
+
"name": "stop",
|
|
288
|
+
"signature": "(options: AssetStopOptions) => Promise<void>",
|
|
289
|
+
"parameters": [
|
|
290
|
+
{
|
|
291
|
+
"name": "options",
|
|
292
|
+
"docs": "",
|
|
293
|
+
"type": "AssetStopOptions"
|
|
294
|
+
}
|
|
295
|
+
],
|
|
296
|
+
"returns": "Promise<void>",
|
|
297
|
+
"tags": [
|
|
298
|
+
{
|
|
299
|
+
"name": "since",
|
|
300
|
+
"text": "5.0.0"
|
|
301
|
+
},
|
|
302
|
+
{
|
|
303
|
+
"name": "param",
|
|
304
|
+
"text": "option"
|
|
305
|
+
},
|
|
306
|
+
{
|
|
307
|
+
"name": "link",
|
|
308
|
+
"text": "AssetStopOptions}"
|
|
309
|
+
},
|
|
310
|
+
{
|
|
311
|
+
"name": "returns"
|
|
312
|
+
}
|
|
313
|
+
],
|
|
314
|
+
"docs": "Stop an audio file",
|
|
315
|
+
"complexTypes": [
|
|
316
|
+
"AssetStopOptions"
|
|
317
|
+
],
|
|
318
|
+
"slug": "stop"
|
|
319
|
+
},
|
|
320
|
+
{
|
|
321
|
+
"name": "unload",
|
|
322
|
+
"signature": "(options: Assets) => Promise<void>",
|
|
323
|
+
"parameters": [
|
|
324
|
+
{
|
|
325
|
+
"name": "options",
|
|
326
|
+
"docs": "",
|
|
327
|
+
"type": "Assets"
|
|
328
|
+
}
|
|
329
|
+
],
|
|
330
|
+
"returns": "Promise<void>",
|
|
331
|
+
"tags": [
|
|
332
|
+
{
|
|
333
|
+
"name": "since",
|
|
334
|
+
"text": "5.0.0"
|
|
335
|
+
},
|
|
336
|
+
{
|
|
337
|
+
"name": "param",
|
|
338
|
+
"text": "option"
|
|
339
|
+
},
|
|
340
|
+
{
|
|
341
|
+
"name": "link",
|
|
342
|
+
"text": "Assets}"
|
|
343
|
+
},
|
|
344
|
+
{
|
|
345
|
+
"name": "returns"
|
|
346
|
+
}
|
|
347
|
+
],
|
|
348
|
+
"docs": "Unload an audio file",
|
|
349
|
+
"complexTypes": [
|
|
350
|
+
"Assets"
|
|
351
|
+
],
|
|
352
|
+
"slug": "unload"
|
|
353
|
+
},
|
|
354
|
+
{
|
|
355
|
+
"name": "setVolume",
|
|
356
|
+
"signature": "(options: AssetVolume) => Promise<void>",
|
|
357
|
+
"parameters": [
|
|
358
|
+
{
|
|
359
|
+
"name": "options",
|
|
360
|
+
"docs": "",
|
|
361
|
+
"type": "AssetVolume"
|
|
362
|
+
}
|
|
363
|
+
],
|
|
364
|
+
"returns": "Promise<void>",
|
|
365
|
+
"tags": [
|
|
366
|
+
{
|
|
367
|
+
"name": "since",
|
|
368
|
+
"text": "5.0.0"
|
|
369
|
+
},
|
|
370
|
+
{
|
|
371
|
+
"name": "param",
|
|
372
|
+
"text": "option"
|
|
373
|
+
},
|
|
374
|
+
{
|
|
375
|
+
"name": "link",
|
|
376
|
+
"text": "AssetVolume}"
|
|
377
|
+
},
|
|
378
|
+
{
|
|
379
|
+
"name": "returns"
|
|
380
|
+
}
|
|
381
|
+
],
|
|
382
|
+
"docs": "Set the volume of an audio file",
|
|
383
|
+
"complexTypes": [
|
|
384
|
+
"AssetVolume"
|
|
385
|
+
],
|
|
386
|
+
"slug": "setvolume"
|
|
387
|
+
},
|
|
388
|
+
{
|
|
389
|
+
"name": "setRate",
|
|
390
|
+
"signature": "(options: AssetRate) => Promise<void>",
|
|
391
|
+
"parameters": [
|
|
392
|
+
{
|
|
393
|
+
"name": "options",
|
|
394
|
+
"docs": "",
|
|
395
|
+
"type": "AssetRate"
|
|
396
|
+
}
|
|
397
|
+
],
|
|
398
|
+
"returns": "Promise<void>",
|
|
399
|
+
"tags": [
|
|
400
|
+
{
|
|
401
|
+
"name": "since",
|
|
402
|
+
"text": "5.0.0"
|
|
403
|
+
},
|
|
404
|
+
{
|
|
405
|
+
"name": "param",
|
|
406
|
+
"text": "option"
|
|
407
|
+
},
|
|
408
|
+
{
|
|
409
|
+
"name": "link",
|
|
410
|
+
"text": "AssetRate}"
|
|
411
|
+
},
|
|
412
|
+
{
|
|
413
|
+
"name": "returns"
|
|
414
|
+
}
|
|
415
|
+
],
|
|
416
|
+
"docs": "Set the rate of an audio file",
|
|
417
|
+
"complexTypes": [
|
|
418
|
+
"AssetRate"
|
|
419
|
+
],
|
|
420
|
+
"slug": "setrate"
|
|
421
|
+
},
|
|
422
|
+
{
|
|
423
|
+
"name": "setCurrentTime",
|
|
424
|
+
"signature": "(options: AssetSetTime) => Promise<void>",
|
|
425
|
+
"parameters": [
|
|
426
|
+
{
|
|
427
|
+
"name": "options",
|
|
428
|
+
"docs": "",
|
|
429
|
+
"type": "AssetSetTime"
|
|
430
|
+
}
|
|
431
|
+
],
|
|
432
|
+
"returns": "Promise<void>",
|
|
433
|
+
"tags": [
|
|
434
|
+
{
|
|
435
|
+
"name": "since",
|
|
436
|
+
"text": "6.5.0"
|
|
437
|
+
},
|
|
438
|
+
{
|
|
439
|
+
"name": "param",
|
|
440
|
+
"text": "option"
|
|
441
|
+
},
|
|
442
|
+
{
|
|
443
|
+
"name": "link",
|
|
444
|
+
"text": "AssetSetTime}"
|
|
445
|
+
},
|
|
446
|
+
{
|
|
447
|
+
"name": "returns"
|
|
448
|
+
}
|
|
449
|
+
],
|
|
450
|
+
"docs": "Set the current time of an audio file",
|
|
451
|
+
"complexTypes": [
|
|
452
|
+
"AssetSetTime"
|
|
453
|
+
],
|
|
454
|
+
"slug": "setcurrenttime"
|
|
455
|
+
},
|
|
456
|
+
{
|
|
457
|
+
"name": "getCurrentTime",
|
|
458
|
+
"signature": "(options: Assets) => Promise<{ currentTime: number; }>",
|
|
459
|
+
"parameters": [
|
|
460
|
+
{
|
|
461
|
+
"name": "options",
|
|
462
|
+
"docs": "",
|
|
463
|
+
"type": "Assets"
|
|
464
|
+
}
|
|
465
|
+
],
|
|
466
|
+
"returns": "Promise<{ currentTime: number; }>",
|
|
467
|
+
"tags": [
|
|
468
|
+
{
|
|
469
|
+
"name": "since",
|
|
470
|
+
"text": "5.0.0"
|
|
471
|
+
},
|
|
472
|
+
{
|
|
473
|
+
"name": "param",
|
|
474
|
+
"text": "option"
|
|
475
|
+
},
|
|
476
|
+
{
|
|
477
|
+
"name": "link",
|
|
478
|
+
"text": "Assets}"
|
|
479
|
+
},
|
|
480
|
+
{
|
|
481
|
+
"name": "returns"
|
|
482
|
+
}
|
|
483
|
+
],
|
|
484
|
+
"docs": "Get the current time of an audio file",
|
|
485
|
+
"complexTypes": [
|
|
486
|
+
"Assets"
|
|
487
|
+
],
|
|
488
|
+
"slug": "getcurrenttime"
|
|
489
|
+
},
|
|
490
|
+
{
|
|
491
|
+
"name": "getDuration",
|
|
492
|
+
"signature": "(options: Assets) => Promise<{ duration: number; }>",
|
|
493
|
+
"parameters": [
|
|
494
|
+
{
|
|
495
|
+
"name": "options",
|
|
496
|
+
"docs": "",
|
|
497
|
+
"type": "Assets"
|
|
498
|
+
}
|
|
499
|
+
],
|
|
500
|
+
"returns": "Promise<{ duration: number; }>",
|
|
501
|
+
"tags": [
|
|
502
|
+
{
|
|
503
|
+
"name": "since",
|
|
504
|
+
"text": "5.0.0"
|
|
505
|
+
},
|
|
506
|
+
{
|
|
507
|
+
"name": "param",
|
|
508
|
+
"text": "option"
|
|
509
|
+
},
|
|
510
|
+
{
|
|
511
|
+
"name": "link",
|
|
512
|
+
"text": "Assets}"
|
|
513
|
+
},
|
|
514
|
+
{
|
|
515
|
+
"name": "returns"
|
|
516
|
+
}
|
|
517
|
+
],
|
|
518
|
+
"docs": "Get the duration of an audio file in seconds",
|
|
519
|
+
"complexTypes": [
|
|
520
|
+
"Assets"
|
|
521
|
+
],
|
|
522
|
+
"slug": "getduration"
|
|
523
|
+
},
|
|
524
|
+
{
|
|
525
|
+
"name": "isPlaying",
|
|
526
|
+
"signature": "(options: Assets) => Promise<{ isPlaying: boolean; }>",
|
|
527
|
+
"parameters": [
|
|
528
|
+
{
|
|
529
|
+
"name": "options",
|
|
530
|
+
"docs": "",
|
|
531
|
+
"type": "Assets"
|
|
532
|
+
}
|
|
533
|
+
],
|
|
534
|
+
"returns": "Promise<{ isPlaying: boolean; }>",
|
|
535
|
+
"tags": [
|
|
536
|
+
{
|
|
537
|
+
"name": "since",
|
|
538
|
+
"text": "5.0.0"
|
|
539
|
+
},
|
|
540
|
+
{
|
|
541
|
+
"name": "param",
|
|
542
|
+
"text": "option"
|
|
543
|
+
},
|
|
544
|
+
{
|
|
545
|
+
"name": "link",
|
|
546
|
+
"text": "Assets}"
|
|
547
|
+
},
|
|
548
|
+
{
|
|
549
|
+
"name": "returns"
|
|
550
|
+
}
|
|
551
|
+
],
|
|
552
|
+
"docs": "Check if an audio file is playing",
|
|
553
|
+
"complexTypes": [
|
|
554
|
+
"Assets"
|
|
555
|
+
],
|
|
556
|
+
"slug": "isplaying"
|
|
557
|
+
},
|
|
558
|
+
{
|
|
559
|
+
"name": "addListener",
|
|
560
|
+
"signature": "(eventName: 'complete', listenerFunc: CompletedListener) => Promise<PluginListenerHandle>",
|
|
561
|
+
"parameters": [
|
|
562
|
+
{
|
|
563
|
+
"name": "eventName",
|
|
564
|
+
"docs": "",
|
|
565
|
+
"type": "'complete'"
|
|
566
|
+
},
|
|
567
|
+
{
|
|
568
|
+
"name": "listenerFunc",
|
|
569
|
+
"docs": "",
|
|
570
|
+
"type": "CompletedListener"
|
|
571
|
+
}
|
|
572
|
+
],
|
|
573
|
+
"returns": "Promise<PluginListenerHandle>",
|
|
574
|
+
"tags": [
|
|
575
|
+
{
|
|
576
|
+
"name": "since",
|
|
577
|
+
"text": "5.0.0\nreturn {@link CompletedEvent}"
|
|
578
|
+
}
|
|
579
|
+
],
|
|
580
|
+
"docs": "Listen for complete event",
|
|
581
|
+
"complexTypes": [
|
|
582
|
+
"PluginListenerHandle",
|
|
583
|
+
"CompletedListener"
|
|
584
|
+
],
|
|
585
|
+
"slug": "addlistenercomplete-"
|
|
586
|
+
},
|
|
587
|
+
{
|
|
588
|
+
"name": "addListener",
|
|
589
|
+
"signature": "(eventName: 'currentTime', listenerFunc: CurrentTimeListener) => Promise<PluginListenerHandle>",
|
|
590
|
+
"parameters": [
|
|
591
|
+
{
|
|
592
|
+
"name": "eventName",
|
|
593
|
+
"docs": "",
|
|
594
|
+
"type": "'currentTime'"
|
|
595
|
+
},
|
|
596
|
+
{
|
|
597
|
+
"name": "listenerFunc",
|
|
598
|
+
"docs": "",
|
|
599
|
+
"type": "CurrentTimeListener"
|
|
600
|
+
}
|
|
601
|
+
],
|
|
602
|
+
"returns": "Promise<PluginListenerHandle>",
|
|
603
|
+
"tags": [
|
|
604
|
+
{
|
|
605
|
+
"name": "since",
|
|
606
|
+
"text": "6.5.0\nreturn {@link CurrentTimeEvent}"
|
|
607
|
+
}
|
|
608
|
+
],
|
|
609
|
+
"docs": "Listen for current time updates\nEmits every 100ms while audio is playing",
|
|
610
|
+
"complexTypes": [
|
|
611
|
+
"PluginListenerHandle",
|
|
612
|
+
"CurrentTimeListener"
|
|
613
|
+
],
|
|
614
|
+
"slug": "addlistenercurrenttime-"
|
|
615
|
+
},
|
|
616
|
+
{
|
|
617
|
+
"name": "addListener",
|
|
618
|
+
"signature": "(eventName: 'playbackState', listenerFunc: PlaybackStateListener) => Promise<PluginListenerHandle>",
|
|
619
|
+
"parameters": [
|
|
620
|
+
{
|
|
621
|
+
"name": "eventName",
|
|
622
|
+
"docs": "",
|
|
623
|
+
"type": "'playbackState'"
|
|
624
|
+
},
|
|
625
|
+
{
|
|
626
|
+
"name": "listenerFunc",
|
|
627
|
+
"docs": "",
|
|
628
|
+
"type": "PlaybackStateListener"
|
|
629
|
+
}
|
|
630
|
+
],
|
|
631
|
+
"returns": "Promise<PluginListenerHandle>",
|
|
632
|
+
"tags": [
|
|
633
|
+
{
|
|
634
|
+
"name": "since",
|
|
635
|
+
"text": "8.3.15\nreturn {@link PlaybackStateEvent}"
|
|
636
|
+
}
|
|
637
|
+
],
|
|
638
|
+
"docs": "Listen for playback state changes, including notification and lock-screen transport controls.\nEmitted by Android and iOS. The current Web implementation does not emit this event.",
|
|
639
|
+
"complexTypes": [
|
|
640
|
+
"PluginListenerHandle",
|
|
641
|
+
"PlaybackStateListener"
|
|
642
|
+
],
|
|
643
|
+
"slug": "addlistenerplaybackstate-"
|
|
644
|
+
},
|
|
645
|
+
{
|
|
646
|
+
"name": "clearCache",
|
|
647
|
+
"signature": "() => Promise<void>",
|
|
648
|
+
"parameters": [],
|
|
649
|
+
"returns": "Promise<void>",
|
|
650
|
+
"tags": [
|
|
651
|
+
{
|
|
652
|
+
"name": "since",
|
|
653
|
+
"text": "6.5.0"
|
|
654
|
+
},
|
|
655
|
+
{
|
|
656
|
+
"name": "returns"
|
|
657
|
+
}
|
|
658
|
+
],
|
|
659
|
+
"docs": "Clear the audio cache for remote audio files",
|
|
660
|
+
"complexTypes": [],
|
|
661
|
+
"slug": "clearcache"
|
|
662
|
+
},
|
|
663
|
+
{
|
|
664
|
+
"name": "setDebugMode",
|
|
665
|
+
"signature": "(options: { enabled: boolean; }) => Promise<void>",
|
|
666
|
+
"parameters": [
|
|
667
|
+
{
|
|
668
|
+
"name": "options",
|
|
669
|
+
"docs": "- Options to enable or disable debug mode",
|
|
670
|
+
"type": "{ enabled: boolean; }"
|
|
671
|
+
}
|
|
672
|
+
],
|
|
673
|
+
"returns": "Promise<void>",
|
|
674
|
+
"tags": [
|
|
675
|
+
{
|
|
676
|
+
"name": "since",
|
|
677
|
+
"text": "6.5.0"
|
|
678
|
+
},
|
|
679
|
+
{
|
|
680
|
+
"name": "param",
|
|
681
|
+
"text": "options - Options to enable or disable debug mode"
|
|
682
|
+
}
|
|
683
|
+
],
|
|
684
|
+
"docs": "Set debug mode logging",
|
|
685
|
+
"complexTypes": [],
|
|
686
|
+
"slug": "setdebugmode"
|
|
687
|
+
},
|
|
688
|
+
{
|
|
689
|
+
"name": "getPluginVersion",
|
|
690
|
+
"signature": "() => Promise<{ version: string; }>",
|
|
691
|
+
"parameters": [],
|
|
692
|
+
"returns": "Promise<{ version: string; }>",
|
|
693
|
+
"tags": [
|
|
694
|
+
{
|
|
695
|
+
"name": "returns",
|
|
696
|
+
"text": "an Promise with version for this device"
|
|
697
|
+
},
|
|
698
|
+
{
|
|
699
|
+
"name": "throws",
|
|
700
|
+
"text": "An error if the something went wrong"
|
|
701
|
+
}
|
|
702
|
+
],
|
|
703
|
+
"docs": "Get the native Capacitor plugin version",
|
|
704
|
+
"complexTypes": [],
|
|
705
|
+
"slug": "getpluginversion"
|
|
706
|
+
},
|
|
707
|
+
{
|
|
708
|
+
"name": "deinitPlugin",
|
|
709
|
+
"signature": "() => Promise<void>",
|
|
710
|
+
"parameters": [],
|
|
711
|
+
"returns": "Promise<void>",
|
|
712
|
+
"tags": [
|
|
713
|
+
{
|
|
714
|
+
"name": "since",
|
|
715
|
+
"text": "7.7.0"
|
|
716
|
+
},
|
|
717
|
+
{
|
|
718
|
+
"name": "returns"
|
|
719
|
+
}
|
|
720
|
+
],
|
|
721
|
+
"docs": "Deinitialize the plugin and restore original audio session settings\nThis method stops all playing audio and reverts any audio session changes made by the plugin\nUse this when you need to ensure compatibility with other audio plugins",
|
|
722
|
+
"complexTypes": [],
|
|
723
|
+
"slug": "deinitplugin"
|
|
724
|
+
}
|
|
725
|
+
],
|
|
726
|
+
"properties": []
|
|
727
|
+
},
|
|
728
|
+
"interfaces": [
|
|
729
|
+
{
|
|
730
|
+
"name": "ConfigureOptions",
|
|
731
|
+
"slug": "configureoptions",
|
|
732
|
+
"docs": "",
|
|
733
|
+
"tags": [],
|
|
734
|
+
"methods": [],
|
|
735
|
+
"properties": [
|
|
736
|
+
{
|
|
737
|
+
"name": "focus",
|
|
738
|
+
"tags": [],
|
|
739
|
+
"docs": "focus the audio with Audio Focus",
|
|
740
|
+
"complexTypes": [],
|
|
741
|
+
"type": "boolean | undefined"
|
|
742
|
+
},
|
|
743
|
+
{
|
|
744
|
+
"name": "background",
|
|
745
|
+
"tags": [],
|
|
746
|
+
"docs": "Play the audio in the background",
|
|
747
|
+
"complexTypes": [],
|
|
748
|
+
"type": "boolean | undefined"
|
|
749
|
+
},
|
|
750
|
+
{
|
|
751
|
+
"name": "ignoreSilent",
|
|
752
|
+
"tags": [],
|
|
753
|
+
"docs": "Ignore silent mode, works only on iOS setting this will nuke other audio apps",
|
|
754
|
+
"complexTypes": [],
|
|
755
|
+
"type": "boolean | undefined"
|
|
756
|
+
},
|
|
757
|
+
{
|
|
758
|
+
"name": "showNotification",
|
|
759
|
+
"tags": [
|
|
760
|
+
{
|
|
761
|
+
"text": "https ://github.com/Cap-go/capacitor-native-audio/issues/202",
|
|
762
|
+
"name": "see"
|
|
763
|
+
}
|
|
764
|
+
],
|
|
765
|
+
"docs": "Show audio playback in the notification center (iOS and Android)\nWhen enabled, displays audio metadata (title, artist, album, artwork) in the system notification\nand Control Center (iOS) or lock screen.\n\n**Important iOS Behavior:**\nEnabling this option changes the audio session category to `.playback` with `.default` mode,\nwhich means your app's audio will **interrupt** other apps' audio (like background music from\nSpotify, Apple Music, etc.) instead of mixing with it. This is required for the Now Playing\ninfo to appear in Control Center and on the lock screen.\n\n**Trade-offs:**\n- `showNotification: true` → Shows Now Playing controls, but interrupts other audio\n- `showNotification: false` → Audio mixes with other apps, but no Now Playing controls\n\nUse this when your app is the primary audio source (music players, podcast apps, etc.).\nDisable this for secondary audio like sound effects or notification sounds where mixing\nwith background music is preferred.",
|
|
766
|
+
"complexTypes": [],
|
|
767
|
+
"type": "boolean | undefined"
|
|
768
|
+
},
|
|
769
|
+
{
|
|
770
|
+
"name": "backgroundPlayback",
|
|
771
|
+
"tags": [
|
|
772
|
+
{
|
|
773
|
+
"text": "false",
|
|
774
|
+
"name": "default"
|
|
775
|
+
},
|
|
776
|
+
{
|
|
777
|
+
"text": "Android",
|
|
778
|
+
"name": "platform"
|
|
779
|
+
},
|
|
780
|
+
{
|
|
781
|
+
"text": "8.2.0",
|
|
782
|
+
"name": "since"
|
|
783
|
+
}
|
|
784
|
+
],
|
|
785
|
+
"docs": "Enable background audio playback (Android only)\n\nWhen enabled, audio will continue playing when the app is backgrounded or the screen is locked.\nThe plugin will skip the automatic pause/resume logic that normally occurs when the app\nenters the background or returns to the foreground.\n\n**Important Android Requirements:**\nTo use background playback on Android, your app must:\n1. Declare the required permissions in `AndroidManifest.xml`:\n - `<uses-permission android:name=\"android.permission.FOREGROUND_SERVICE\" />`\n - `<uses-permission android:name=\"android.permission.FOREGROUND_SERVICE_MEDIA_PLAYBACK\" />`\n - `<uses-permission android:name=\"android.permission.WAKE_LOCK\" />`\n2. Start a Foreground Service with a media-style notification before backgrounding\n (the plugin does not automatically create or manage the foreground service)\n3. Use `showNotification: true` to display playback controls in the notification\n\n**Usage Example:**\n```typescript\nawait NativeAudio.configure({\n backgroundPlayback: true,\n showNotification: true\n});\n// Start your foreground service here\n// Then preload and play audio as normal\n```",
|
|
786
|
+
"complexTypes": [],
|
|
787
|
+
"type": "boolean | undefined"
|
|
788
|
+
}
|
|
789
|
+
]
|
|
790
|
+
},
|
|
791
|
+
{
|
|
792
|
+
"name": "PreloadOptions",
|
|
793
|
+
"slug": "preloadoptions",
|
|
794
|
+
"docs": "",
|
|
795
|
+
"tags": [],
|
|
796
|
+
"methods": [],
|
|
797
|
+
"properties": [
|
|
798
|
+
{
|
|
799
|
+
"name": "assetPath",
|
|
800
|
+
"tags": [],
|
|
801
|
+
"docs": "Path to the audio file, relative path of the file, absolute url (file://) or remote url (https://)\nSupported formats:\n- MP3, WAV (all platforms)\n- M3U8/HLS streams (iOS and Android)",
|
|
802
|
+
"complexTypes": [],
|
|
803
|
+
"type": "string"
|
|
804
|
+
},
|
|
805
|
+
{
|
|
806
|
+
"name": "assetId",
|
|
807
|
+
"tags": [],
|
|
808
|
+
"docs": "Asset Id, unique identifier of the file",
|
|
809
|
+
"complexTypes": [],
|
|
810
|
+
"type": "string"
|
|
811
|
+
},
|
|
812
|
+
{
|
|
813
|
+
"name": "volume",
|
|
814
|
+
"tags": [],
|
|
815
|
+
"docs": "Volume of the audio, between 0.1 and 1.0",
|
|
816
|
+
"complexTypes": [],
|
|
817
|
+
"type": "number | undefined"
|
|
818
|
+
},
|
|
819
|
+
{
|
|
820
|
+
"name": "audioChannelNum",
|
|
821
|
+
"tags": [],
|
|
822
|
+
"docs": "Audio channel number, default is 1",
|
|
823
|
+
"complexTypes": [],
|
|
824
|
+
"type": "number | undefined"
|
|
825
|
+
},
|
|
826
|
+
{
|
|
827
|
+
"name": "isUrl",
|
|
828
|
+
"tags": [],
|
|
829
|
+
"docs": "Is the audio file a URL, pass true if assetPath is a `file://` url\nor a streaming URL (m3u8)",
|
|
830
|
+
"complexTypes": [],
|
|
831
|
+
"type": "boolean | undefined"
|
|
832
|
+
},
|
|
833
|
+
{
|
|
834
|
+
"name": "notificationMetadata",
|
|
835
|
+
"tags": [
|
|
836
|
+
{
|
|
837
|
+
"text": "NotificationMetadata",
|
|
838
|
+
"name": "see"
|
|
839
|
+
}
|
|
840
|
+
],
|
|
841
|
+
"docs": "Metadata to display in the notification center when audio is playing.\nOnly used when `showNotification: true` is set in `configure()`.\n\nSee {@link ConfigureOptions.showNotification} for important details about\nhow this affects audio mixing behavior on iOS.",
|
|
842
|
+
"complexTypes": [
|
|
843
|
+
"NotificationMetadata"
|
|
844
|
+
],
|
|
845
|
+
"type": "NotificationMetadata"
|
|
846
|
+
},
|
|
847
|
+
{
|
|
848
|
+
"name": "headers",
|
|
849
|
+
"tags": [
|
|
850
|
+
{
|
|
851
|
+
"text": "7.10.0",
|
|
852
|
+
"name": "since"
|
|
853
|
+
}
|
|
854
|
+
],
|
|
855
|
+
"docs": "Custom HTTP headers to include when fetching remote audio files.\nOnly used when isUrl is true and assetPath is a remote URL (http/https).\nExample: { 'x-api-key': 'abc123', 'Authorization': 'Bearer token' }",
|
|
856
|
+
"complexTypes": [
|
|
857
|
+
"Record"
|
|
858
|
+
],
|
|
859
|
+
"type": "Record<string, string>"
|
|
860
|
+
}
|
|
861
|
+
]
|
|
862
|
+
},
|
|
863
|
+
{
|
|
864
|
+
"name": "NotificationMetadata",
|
|
865
|
+
"slug": "notificationmetadata",
|
|
866
|
+
"docs": "Metadata to display in the notification center, Control Center (iOS), and lock screen\nwhen `showNotification` is enabled in `configure()`.\n\nNote: This metadata will only be displayed if `showNotification: true` is set in the\n`configure()` method. See {@link ConfigureOptions.showNotification} for important\nbehavior details about audio mixing on iOS.",
|
|
867
|
+
"tags": [],
|
|
868
|
+
"methods": [],
|
|
869
|
+
"properties": [
|
|
870
|
+
{
|
|
871
|
+
"name": "title",
|
|
872
|
+
"tags": [],
|
|
873
|
+
"docs": "The title to display in the notification center",
|
|
874
|
+
"complexTypes": [],
|
|
875
|
+
"type": "string | undefined"
|
|
876
|
+
},
|
|
877
|
+
{
|
|
878
|
+
"name": "artist",
|
|
879
|
+
"tags": [],
|
|
880
|
+
"docs": "The artist name to display in the notification center",
|
|
881
|
+
"complexTypes": [],
|
|
882
|
+
"type": "string | undefined"
|
|
883
|
+
},
|
|
884
|
+
{
|
|
885
|
+
"name": "album",
|
|
886
|
+
"tags": [],
|
|
887
|
+
"docs": "The album name to display in the notification center",
|
|
888
|
+
"complexTypes": [],
|
|
889
|
+
"type": "string | undefined"
|
|
890
|
+
},
|
|
891
|
+
{
|
|
892
|
+
"name": "artworkUrl",
|
|
893
|
+
"tags": [],
|
|
894
|
+
"docs": "URL or local path to the artwork/album art image",
|
|
895
|
+
"complexTypes": [],
|
|
896
|
+
"type": "string | undefined"
|
|
897
|
+
}
|
|
898
|
+
]
|
|
899
|
+
},
|
|
900
|
+
{
|
|
901
|
+
"name": "PlayOnceResult",
|
|
902
|
+
"slug": "playonceresult",
|
|
903
|
+
"docs": "",
|
|
904
|
+
"tags": [],
|
|
905
|
+
"methods": [],
|
|
906
|
+
"properties": [
|
|
907
|
+
{
|
|
908
|
+
"name": "assetId",
|
|
909
|
+
"tags": [],
|
|
910
|
+
"docs": "The internally generated asset ID for this playback\nCan be used to control playback (pause, stop, etc.) before completion",
|
|
911
|
+
"complexTypes": [],
|
|
912
|
+
"type": "string"
|
|
913
|
+
}
|
|
914
|
+
]
|
|
915
|
+
},
|
|
916
|
+
{
|
|
917
|
+
"name": "PlayOnceOptions",
|
|
918
|
+
"slug": "playonceoptions",
|
|
919
|
+
"docs": "",
|
|
920
|
+
"tags": [],
|
|
921
|
+
"methods": [],
|
|
922
|
+
"properties": [
|
|
923
|
+
{
|
|
924
|
+
"name": "assetPath",
|
|
925
|
+
"tags": [],
|
|
926
|
+
"docs": "Path to the audio file, relative path of the file, absolute url (file://) or remote url (https://)\nSupported formats:\n- MP3, WAV (all platforms)\n- M3U8/HLS streams (iOS and Android)",
|
|
927
|
+
"complexTypes": [],
|
|
928
|
+
"type": "string"
|
|
929
|
+
},
|
|
930
|
+
{
|
|
931
|
+
"name": "volume",
|
|
932
|
+
"tags": [
|
|
933
|
+
{
|
|
934
|
+
"text": "1.0",
|
|
935
|
+
"name": "default"
|
|
936
|
+
}
|
|
937
|
+
],
|
|
938
|
+
"docs": "Volume of the audio, between 0.1 and 1.0",
|
|
939
|
+
"complexTypes": [],
|
|
940
|
+
"type": "number | undefined"
|
|
941
|
+
},
|
|
942
|
+
{
|
|
943
|
+
"name": "isUrl",
|
|
944
|
+
"tags": [
|
|
945
|
+
{
|
|
946
|
+
"text": "false",
|
|
947
|
+
"name": "default"
|
|
948
|
+
}
|
|
949
|
+
],
|
|
950
|
+
"docs": "Is the audio file a URL, pass true if assetPath is a `file://` url\nor a streaming URL (m3u8)",
|
|
951
|
+
"complexTypes": [],
|
|
952
|
+
"type": "boolean | undefined"
|
|
953
|
+
},
|
|
954
|
+
{
|
|
955
|
+
"name": "autoPlay",
|
|
956
|
+
"tags": [
|
|
957
|
+
{
|
|
958
|
+
"text": "true",
|
|
959
|
+
"name": "default"
|
|
960
|
+
}
|
|
961
|
+
],
|
|
962
|
+
"docs": "Automatically start playback after loading",
|
|
963
|
+
"complexTypes": [],
|
|
964
|
+
"type": "boolean | undefined"
|
|
965
|
+
},
|
|
966
|
+
{
|
|
967
|
+
"name": "deleteAfterPlay",
|
|
968
|
+
"tags": [
|
|
969
|
+
{
|
|
970
|
+
"text": "false",
|
|
971
|
+
"name": "default"
|
|
972
|
+
},
|
|
973
|
+
{
|
|
974
|
+
"text": "7.11.0",
|
|
975
|
+
"name": "since"
|
|
976
|
+
}
|
|
977
|
+
],
|
|
978
|
+
"docs": "Delete the audio file from disk after playback completes\nOnly works for local files (file:// URLs), ignored for remote URLs",
|
|
979
|
+
"complexTypes": [],
|
|
980
|
+
"type": "boolean | undefined"
|
|
981
|
+
},
|
|
982
|
+
{
|
|
983
|
+
"name": "notificationMetadata",
|
|
984
|
+
"tags": [
|
|
985
|
+
{
|
|
986
|
+
"text": "NotificationMetadata *",
|
|
987
|
+
"name": "see"
|
|
988
|
+
},
|
|
989
|
+
{
|
|
990
|
+
"text": "7.10.0",
|
|
991
|
+
"name": "since"
|
|
992
|
+
}
|
|
993
|
+
],
|
|
994
|
+
"docs": "Metadata to display in the notification center when audio is playing.\nOnly used when `showNotification: true` is set in `configure()`.\n\nSee {@link ConfigureOptions.showNotification} for important details about\nhow this affects audio mixing behavior on iOS.",
|
|
995
|
+
"complexTypes": [
|
|
996
|
+
"NotificationMetadata"
|
|
997
|
+
],
|
|
998
|
+
"type": "NotificationMetadata"
|
|
999
|
+
},
|
|
1000
|
+
{
|
|
1001
|
+
"name": "headers",
|
|
1002
|
+
"tags": [
|
|
1003
|
+
{
|
|
1004
|
+
"text": "7.10.0",
|
|
1005
|
+
"name": "since"
|
|
1006
|
+
}
|
|
1007
|
+
],
|
|
1008
|
+
"docs": "Custom HTTP headers to include when fetching remote audio files.\nOnly used when isUrl is true and assetPath is a remote URL (http/https).\nExample: { 'x-api-key': 'abc123', 'Authorization': 'Bearer token' }",
|
|
1009
|
+
"complexTypes": [
|
|
1010
|
+
"Record"
|
|
1011
|
+
],
|
|
1012
|
+
"type": "Record<string, string>"
|
|
1013
|
+
}
|
|
1014
|
+
]
|
|
1015
|
+
},
|
|
1016
|
+
{
|
|
1017
|
+
"name": "AssetPlayOptions",
|
|
1018
|
+
"slug": "assetplayoptions",
|
|
1019
|
+
"docs": "",
|
|
1020
|
+
"tags": [],
|
|
1021
|
+
"methods": [],
|
|
1022
|
+
"properties": [
|
|
1023
|
+
{
|
|
1024
|
+
"name": "assetId",
|
|
1025
|
+
"tags": [],
|
|
1026
|
+
"docs": "Asset Id, unique identifier of the file",
|
|
1027
|
+
"complexTypes": [],
|
|
1028
|
+
"type": "string"
|
|
1029
|
+
},
|
|
1030
|
+
{
|
|
1031
|
+
"name": "time",
|
|
1032
|
+
"tags": [],
|
|
1033
|
+
"docs": "Time to start playing the audio, in seconds",
|
|
1034
|
+
"complexTypes": [],
|
|
1035
|
+
"type": "number | undefined"
|
|
1036
|
+
},
|
|
1037
|
+
{
|
|
1038
|
+
"name": "delay",
|
|
1039
|
+
"tags": [],
|
|
1040
|
+
"docs": "Delay to start playing the audio, in seconds",
|
|
1041
|
+
"complexTypes": [],
|
|
1042
|
+
"type": "number | undefined"
|
|
1043
|
+
},
|
|
1044
|
+
{
|
|
1045
|
+
"name": "volume",
|
|
1046
|
+
"tags": [],
|
|
1047
|
+
"docs": "Volume of the audio, between 0.1 and 1.0",
|
|
1048
|
+
"complexTypes": [],
|
|
1049
|
+
"type": "number | undefined"
|
|
1050
|
+
},
|
|
1051
|
+
{
|
|
1052
|
+
"name": "fadeIn",
|
|
1053
|
+
"tags": [],
|
|
1054
|
+
"docs": "Whether to fade in the audio",
|
|
1055
|
+
"complexTypes": [],
|
|
1056
|
+
"type": "boolean | undefined"
|
|
1057
|
+
},
|
|
1058
|
+
{
|
|
1059
|
+
"name": "fadeOut",
|
|
1060
|
+
"tags": [],
|
|
1061
|
+
"docs": "Whether to fade out the audio",
|
|
1062
|
+
"complexTypes": [],
|
|
1063
|
+
"type": "boolean | undefined"
|
|
1064
|
+
},
|
|
1065
|
+
{
|
|
1066
|
+
"name": "fadeInDuration",
|
|
1067
|
+
"tags": [],
|
|
1068
|
+
"docs": "Fade in duration in seconds.\nOnly used if fadeIn is true.\nDefault is 1s.",
|
|
1069
|
+
"complexTypes": [],
|
|
1070
|
+
"type": "number | undefined"
|
|
1071
|
+
},
|
|
1072
|
+
{
|
|
1073
|
+
"name": "fadeOutDuration",
|
|
1074
|
+
"tags": [],
|
|
1075
|
+
"docs": "Fade out duration in seconds.\nOnly used if fadeOut is true.\nDefault is 1s.",
|
|
1076
|
+
"complexTypes": [],
|
|
1077
|
+
"type": "number | undefined"
|
|
1078
|
+
},
|
|
1079
|
+
{
|
|
1080
|
+
"name": "fadeOutStartTime",
|
|
1081
|
+
"tags": [],
|
|
1082
|
+
"docs": "Time in seconds from the start of the audio to start fading out.\nOnly used if fadeOut is true.\nDefault is fadeOutDuration before end of audio.",
|
|
1083
|
+
"complexTypes": [],
|
|
1084
|
+
"type": "number | undefined"
|
|
1085
|
+
}
|
|
1086
|
+
]
|
|
1087
|
+
},
|
|
1088
|
+
{
|
|
1089
|
+
"name": "AssetPauseOptions",
|
|
1090
|
+
"slug": "assetpauseoptions",
|
|
1091
|
+
"docs": "",
|
|
1092
|
+
"tags": [],
|
|
1093
|
+
"methods": [],
|
|
1094
|
+
"properties": [
|
|
1095
|
+
{
|
|
1096
|
+
"name": "assetId",
|
|
1097
|
+
"tags": [],
|
|
1098
|
+
"docs": "Asset Id, unique identifier of the file",
|
|
1099
|
+
"complexTypes": [],
|
|
1100
|
+
"type": "string"
|
|
1101
|
+
},
|
|
1102
|
+
{
|
|
1103
|
+
"name": "fadeOut",
|
|
1104
|
+
"tags": [],
|
|
1105
|
+
"docs": "Whether to fade out the audio before pausing",
|
|
1106
|
+
"complexTypes": [],
|
|
1107
|
+
"type": "boolean | undefined"
|
|
1108
|
+
},
|
|
1109
|
+
{
|
|
1110
|
+
"name": "fadeOutDuration",
|
|
1111
|
+
"tags": [],
|
|
1112
|
+
"docs": "Fade out duration in seconds.\nDefault is 1s.",
|
|
1113
|
+
"complexTypes": [],
|
|
1114
|
+
"type": "number | undefined"
|
|
1115
|
+
}
|
|
1116
|
+
]
|
|
1117
|
+
},
|
|
1118
|
+
{
|
|
1119
|
+
"name": "AssetResumeOptions",
|
|
1120
|
+
"slug": "assetresumeoptions",
|
|
1121
|
+
"docs": "",
|
|
1122
|
+
"tags": [],
|
|
1123
|
+
"methods": [],
|
|
1124
|
+
"properties": [
|
|
1125
|
+
{
|
|
1126
|
+
"name": "assetId",
|
|
1127
|
+
"tags": [],
|
|
1128
|
+
"docs": "Asset Id, unique identifier of the file",
|
|
1129
|
+
"complexTypes": [],
|
|
1130
|
+
"type": "string"
|
|
1131
|
+
},
|
|
1132
|
+
{
|
|
1133
|
+
"name": "fadeIn",
|
|
1134
|
+
"tags": [],
|
|
1135
|
+
"docs": "Whether to fade in the audio during resume",
|
|
1136
|
+
"complexTypes": [],
|
|
1137
|
+
"type": "boolean | undefined"
|
|
1138
|
+
},
|
|
1139
|
+
{
|
|
1140
|
+
"name": "fadeInDuration",
|
|
1141
|
+
"tags": [],
|
|
1142
|
+
"docs": "Fade in duration in seconds.\nDefault is 1s.",
|
|
1143
|
+
"complexTypes": [],
|
|
1144
|
+
"type": "number | undefined"
|
|
1145
|
+
}
|
|
1146
|
+
]
|
|
1147
|
+
},
|
|
1148
|
+
{
|
|
1149
|
+
"name": "Assets",
|
|
1150
|
+
"slug": "assets",
|
|
1151
|
+
"docs": "",
|
|
1152
|
+
"tags": [],
|
|
1153
|
+
"methods": [],
|
|
1154
|
+
"properties": [
|
|
1155
|
+
{
|
|
1156
|
+
"name": "assetId",
|
|
1157
|
+
"tags": [],
|
|
1158
|
+
"docs": "Asset Id, unique identifier of the file",
|
|
1159
|
+
"complexTypes": [],
|
|
1160
|
+
"type": "string"
|
|
1161
|
+
}
|
|
1162
|
+
]
|
|
1163
|
+
},
|
|
1164
|
+
{
|
|
1165
|
+
"name": "AssetStopOptions",
|
|
1166
|
+
"slug": "assetstopoptions",
|
|
1167
|
+
"docs": "",
|
|
1168
|
+
"tags": [],
|
|
1169
|
+
"methods": [],
|
|
1170
|
+
"properties": [
|
|
1171
|
+
{
|
|
1172
|
+
"name": "assetId",
|
|
1173
|
+
"tags": [],
|
|
1174
|
+
"docs": "Asset Id, unique identifier of the file",
|
|
1175
|
+
"complexTypes": [],
|
|
1176
|
+
"type": "string"
|
|
1177
|
+
},
|
|
1178
|
+
{
|
|
1179
|
+
"name": "fadeOut",
|
|
1180
|
+
"tags": [],
|
|
1181
|
+
"docs": "Whether to fade out the audio before stopping",
|
|
1182
|
+
"complexTypes": [],
|
|
1183
|
+
"type": "boolean | undefined"
|
|
1184
|
+
},
|
|
1185
|
+
{
|
|
1186
|
+
"name": "fadeOutDuration",
|
|
1187
|
+
"tags": [],
|
|
1188
|
+
"docs": "Fade out duration in seconds.\nDefault is 1s.",
|
|
1189
|
+
"complexTypes": [],
|
|
1190
|
+
"type": "number | undefined"
|
|
1191
|
+
}
|
|
1192
|
+
]
|
|
1193
|
+
},
|
|
1194
|
+
{
|
|
1195
|
+
"name": "AssetVolume",
|
|
1196
|
+
"slug": "assetvolume",
|
|
1197
|
+
"docs": "",
|
|
1198
|
+
"tags": [],
|
|
1199
|
+
"methods": [],
|
|
1200
|
+
"properties": [
|
|
1201
|
+
{
|
|
1202
|
+
"name": "assetId",
|
|
1203
|
+
"tags": [],
|
|
1204
|
+
"docs": "Asset Id, unique identifier of the file",
|
|
1205
|
+
"complexTypes": [],
|
|
1206
|
+
"type": "string"
|
|
1207
|
+
},
|
|
1208
|
+
{
|
|
1209
|
+
"name": "volume",
|
|
1210
|
+
"tags": [],
|
|
1211
|
+
"docs": "Volume of the audio, between 0.1 and 1.0",
|
|
1212
|
+
"complexTypes": [],
|
|
1213
|
+
"type": "number"
|
|
1214
|
+
},
|
|
1215
|
+
{
|
|
1216
|
+
"name": "duration",
|
|
1217
|
+
"tags": [],
|
|
1218
|
+
"docs": "Time over which to fade to the target volume, in seconds. Default is 0s (immediate).",
|
|
1219
|
+
"complexTypes": [],
|
|
1220
|
+
"type": "number | undefined"
|
|
1221
|
+
}
|
|
1222
|
+
]
|
|
1223
|
+
},
|
|
1224
|
+
{
|
|
1225
|
+
"name": "AssetRate",
|
|
1226
|
+
"slug": "assetrate",
|
|
1227
|
+
"docs": "",
|
|
1228
|
+
"tags": [],
|
|
1229
|
+
"methods": [],
|
|
1230
|
+
"properties": [
|
|
1231
|
+
{
|
|
1232
|
+
"name": "assetId",
|
|
1233
|
+
"tags": [],
|
|
1234
|
+
"docs": "Asset Id, unique identifier of the file",
|
|
1235
|
+
"complexTypes": [],
|
|
1236
|
+
"type": "string"
|
|
1237
|
+
},
|
|
1238
|
+
{
|
|
1239
|
+
"name": "rate",
|
|
1240
|
+
"tags": [],
|
|
1241
|
+
"docs": "Rate of the audio, between 0.1 and 1.0",
|
|
1242
|
+
"complexTypes": [],
|
|
1243
|
+
"type": "number"
|
|
1244
|
+
}
|
|
1245
|
+
]
|
|
1246
|
+
},
|
|
1247
|
+
{
|
|
1248
|
+
"name": "AssetSetTime",
|
|
1249
|
+
"slug": "assetsettime",
|
|
1250
|
+
"docs": "",
|
|
1251
|
+
"tags": [],
|
|
1252
|
+
"methods": [],
|
|
1253
|
+
"properties": [
|
|
1254
|
+
{
|
|
1255
|
+
"name": "assetId",
|
|
1256
|
+
"tags": [],
|
|
1257
|
+
"docs": "Asset Id, unique identifier of the file",
|
|
1258
|
+
"complexTypes": [],
|
|
1259
|
+
"type": "string"
|
|
1260
|
+
},
|
|
1261
|
+
{
|
|
1262
|
+
"name": "time",
|
|
1263
|
+
"tags": [],
|
|
1264
|
+
"docs": "Time to set the audio, in seconds",
|
|
1265
|
+
"complexTypes": [],
|
|
1266
|
+
"type": "number"
|
|
1267
|
+
}
|
|
1268
|
+
]
|
|
1269
|
+
},
|
|
1270
|
+
{
|
|
1271
|
+
"name": "PluginListenerHandle",
|
|
1272
|
+
"slug": "pluginlistenerhandle",
|
|
1273
|
+
"docs": "",
|
|
1274
|
+
"tags": [],
|
|
1275
|
+
"methods": [],
|
|
1276
|
+
"properties": [
|
|
1277
|
+
{
|
|
1278
|
+
"name": "remove",
|
|
1279
|
+
"tags": [],
|
|
1280
|
+
"docs": "",
|
|
1281
|
+
"complexTypes": [],
|
|
1282
|
+
"type": "() => Promise<void>"
|
|
1283
|
+
}
|
|
1284
|
+
]
|
|
1285
|
+
},
|
|
1286
|
+
{
|
|
1287
|
+
"name": "CompletedEvent",
|
|
1288
|
+
"slug": "completedevent",
|
|
1289
|
+
"docs": "",
|
|
1290
|
+
"tags": [],
|
|
1291
|
+
"methods": [],
|
|
1292
|
+
"properties": [
|
|
1293
|
+
{
|
|
1294
|
+
"name": "assetId",
|
|
1295
|
+
"tags": [
|
|
1296
|
+
{
|
|
1297
|
+
"text": "5.0.0",
|
|
1298
|
+
"name": "since"
|
|
1299
|
+
}
|
|
1300
|
+
],
|
|
1301
|
+
"docs": "Emit when a play completes",
|
|
1302
|
+
"complexTypes": [],
|
|
1303
|
+
"type": "string"
|
|
1304
|
+
}
|
|
1305
|
+
]
|
|
1306
|
+
},
|
|
1307
|
+
{
|
|
1308
|
+
"name": "CurrentTimeEvent",
|
|
1309
|
+
"slug": "currenttimeevent",
|
|
1310
|
+
"docs": "",
|
|
1311
|
+
"tags": [],
|
|
1312
|
+
"methods": [],
|
|
1313
|
+
"properties": [
|
|
1314
|
+
{
|
|
1315
|
+
"name": "currentTime",
|
|
1316
|
+
"tags": [
|
|
1317
|
+
{
|
|
1318
|
+
"text": "6.5.0",
|
|
1319
|
+
"name": "since"
|
|
1320
|
+
}
|
|
1321
|
+
],
|
|
1322
|
+
"docs": "Current time of the audio in seconds",
|
|
1323
|
+
"complexTypes": [],
|
|
1324
|
+
"type": "number"
|
|
1325
|
+
},
|
|
1326
|
+
{
|
|
1327
|
+
"name": "assetId",
|
|
1328
|
+
"tags": [
|
|
1329
|
+
{
|
|
1330
|
+
"text": "6.5.0",
|
|
1331
|
+
"name": "since"
|
|
1332
|
+
}
|
|
1333
|
+
],
|
|
1334
|
+
"docs": "Asset Id of the audio",
|
|
1335
|
+
"complexTypes": [],
|
|
1336
|
+
"type": "string"
|
|
1337
|
+
}
|
|
1338
|
+
]
|
|
1339
|
+
},
|
|
1340
|
+
{
|
|
1341
|
+
"name": "PlaybackStateEvent",
|
|
1342
|
+
"slug": "playbackstateevent",
|
|
1343
|
+
"docs": "",
|
|
1344
|
+
"tags": [],
|
|
1345
|
+
"methods": [],
|
|
1346
|
+
"properties": [
|
|
1347
|
+
{
|
|
1348
|
+
"name": "assetId",
|
|
1349
|
+
"tags": [],
|
|
1350
|
+
"docs": "Asset Id of the audio",
|
|
1351
|
+
"complexTypes": [],
|
|
1352
|
+
"type": "string"
|
|
1353
|
+
},
|
|
1354
|
+
{
|
|
1355
|
+
"name": "state",
|
|
1356
|
+
"tags": [],
|
|
1357
|
+
"docs": "Resolved playback state after a local or remote transport action.",
|
|
1358
|
+
"complexTypes": [
|
|
1359
|
+
"PlaybackStateValue"
|
|
1360
|
+
],
|
|
1361
|
+
"type": "PlaybackStateValue"
|
|
1362
|
+
},
|
|
1363
|
+
{
|
|
1364
|
+
"name": "reason",
|
|
1365
|
+
"tags": [],
|
|
1366
|
+
"docs": "Reason for the state change, for example `play`, `pause`, `remotePlay`, or `complete`.",
|
|
1367
|
+
"complexTypes": [],
|
|
1368
|
+
"type": "string"
|
|
1369
|
+
},
|
|
1370
|
+
{
|
|
1371
|
+
"name": "isPlaying",
|
|
1372
|
+
"tags": [],
|
|
1373
|
+
"docs": "Whether the asset is currently playing.",
|
|
1374
|
+
"complexTypes": [],
|
|
1375
|
+
"type": "boolean"
|
|
1376
|
+
},
|
|
1377
|
+
{
|
|
1378
|
+
"name": "currentTime",
|
|
1379
|
+
"tags": [],
|
|
1380
|
+
"docs": "Current playback position in seconds when available.",
|
|
1381
|
+
"complexTypes": [],
|
|
1382
|
+
"type": "number | undefined"
|
|
1383
|
+
},
|
|
1384
|
+
{
|
|
1385
|
+
"name": "duration",
|
|
1386
|
+
"tags": [],
|
|
1387
|
+
"docs": "Total playback duration in seconds when available.",
|
|
1388
|
+
"complexTypes": [],
|
|
1389
|
+
"type": "number | undefined"
|
|
1390
|
+
}
|
|
1391
|
+
]
|
|
1392
|
+
}
|
|
1393
|
+
],
|
|
1394
|
+
"enums": [],
|
|
1395
|
+
"typeAliases": [
|
|
1396
|
+
{
|
|
1397
|
+
"name": "Record",
|
|
1398
|
+
"slug": "record",
|
|
1399
|
+
"docs": "Construct a type with a set of properties K of type T",
|
|
1400
|
+
"types": [
|
|
1401
|
+
{
|
|
1402
|
+
"text": "{\r\n [P in K]: T;\r\n}",
|
|
1403
|
+
"complexTypes": [
|
|
1404
|
+
"K",
|
|
1405
|
+
"T"
|
|
1406
|
+
]
|
|
1407
|
+
}
|
|
1408
|
+
]
|
|
1409
|
+
},
|
|
1410
|
+
{
|
|
1411
|
+
"name": "CompletedListener",
|
|
1412
|
+
"slug": "completedlistener",
|
|
1413
|
+
"docs": "",
|
|
1414
|
+
"types": [
|
|
1415
|
+
{
|
|
1416
|
+
"text": "(state: CompletedEvent): void",
|
|
1417
|
+
"complexTypes": [
|
|
1418
|
+
"CompletedEvent"
|
|
1419
|
+
]
|
|
1420
|
+
}
|
|
1421
|
+
]
|
|
1422
|
+
},
|
|
1423
|
+
{
|
|
1424
|
+
"name": "CurrentTimeListener",
|
|
1425
|
+
"slug": "currenttimelistener",
|
|
1426
|
+
"docs": "",
|
|
1427
|
+
"types": [
|
|
1428
|
+
{
|
|
1429
|
+
"text": "(state: CurrentTimeEvent): void",
|
|
1430
|
+
"complexTypes": [
|
|
1431
|
+
"CurrentTimeEvent"
|
|
1432
|
+
]
|
|
1433
|
+
}
|
|
1434
|
+
]
|
|
1435
|
+
},
|
|
1436
|
+
{
|
|
1437
|
+
"name": "PlaybackStateListener",
|
|
1438
|
+
"slug": "playbackstatelistener",
|
|
1439
|
+
"docs": "",
|
|
1440
|
+
"types": [
|
|
1441
|
+
{
|
|
1442
|
+
"text": "(state: PlaybackStateEvent): void",
|
|
1443
|
+
"complexTypes": [
|
|
1444
|
+
"PlaybackStateEvent"
|
|
1445
|
+
]
|
|
1446
|
+
}
|
|
1447
|
+
]
|
|
1448
|
+
},
|
|
1449
|
+
{
|
|
1450
|
+
"name": "PlaybackStateValue",
|
|
1451
|
+
"slug": "playbackstatevalue",
|
|
1452
|
+
"docs": "",
|
|
1453
|
+
"types": [
|
|
1454
|
+
{
|
|
1455
|
+
"text": "'playing'",
|
|
1456
|
+
"complexTypes": []
|
|
1457
|
+
},
|
|
1458
|
+
{
|
|
1459
|
+
"text": "'paused'",
|
|
1460
|
+
"complexTypes": []
|
|
1461
|
+
},
|
|
1462
|
+
{
|
|
1463
|
+
"text": "'stopped'",
|
|
1464
|
+
"complexTypes": []
|
|
1465
|
+
}
|
|
1466
|
+
]
|
|
1467
|
+
}
|
|
1468
|
+
],
|
|
1469
|
+
"pluginConfigs": []
|
|
1470
|
+
}
|