capacitor-plugin-recorder 0.0.1
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/CapacitorPluginRecorder.podspec +17 -0
- package/Package.swift +28 -0
- package/README.md +395 -0
- package/android/build.gradle +58 -0
- package/android/src/main/AndroidManifest.xml +3 -0
- package/android/src/main/java/com/capacitor/recorderplayer/RecorderPlayer.java +524 -0
- package/android/src/main/java/com/capacitor/recorderplayer/RecorderPlayerPlugin.java +302 -0
- package/android/src/main/res/.gitkeep +0 -0
- package/dist/docs.json +562 -0
- package/dist/esm/definitions.d.ts +125 -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 +30 -0
- package/dist/esm/web.js +279 -0
- package/dist/esm/web.js.map +1 -0
- package/dist/plugin.cjs.js +293 -0
- package/dist/plugin.cjs.js.map +1 -0
- package/dist/plugin.js +296 -0
- package/dist/plugin.js.map +1 -0
- package/ios/Sources/RecorderPlayerPlugin/RecorderPlayer.swift +318 -0
- package/ios/Sources/RecorderPlayerPlugin/RecorderPlayerPlugin.swift +249 -0
- package/ios/Tests/RecorderPlayerPluginTests/RecorderPlayerTests.swift +15 -0
- package/package.json +80 -0
package/dist/docs.json
ADDED
|
@@ -0,0 +1,562 @@
|
|
|
1
|
+
{
|
|
2
|
+
"api": {
|
|
3
|
+
"name": "RecorderPlayerPlugin",
|
|
4
|
+
"slug": "recorderplayerplugin",
|
|
5
|
+
"docs": "",
|
|
6
|
+
"tags": [],
|
|
7
|
+
"methods": [
|
|
8
|
+
{
|
|
9
|
+
"name": "requestPermission",
|
|
10
|
+
"signature": "() => Promise<PermissionStatus>",
|
|
11
|
+
"parameters": [],
|
|
12
|
+
"returns": "Promise<PermissionStatus>",
|
|
13
|
+
"tags": [],
|
|
14
|
+
"docs": "Request microphone permission",
|
|
15
|
+
"complexTypes": [
|
|
16
|
+
"PermissionStatus"
|
|
17
|
+
],
|
|
18
|
+
"slug": "requestpermission"
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
"name": "checkPermission",
|
|
22
|
+
"signature": "() => Promise<PermissionStatus>",
|
|
23
|
+
"parameters": [],
|
|
24
|
+
"returns": "Promise<PermissionStatus>",
|
|
25
|
+
"tags": [],
|
|
26
|
+
"docs": "Check current permission status",
|
|
27
|
+
"complexTypes": [
|
|
28
|
+
"PermissionStatus"
|
|
29
|
+
],
|
|
30
|
+
"slug": "checkpermission"
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
"name": "startRecord",
|
|
34
|
+
"signature": "(options?: StartRecordOptions | undefined) => Promise<void>",
|
|
35
|
+
"parameters": [
|
|
36
|
+
{
|
|
37
|
+
"name": "options",
|
|
38
|
+
"docs": "",
|
|
39
|
+
"type": "StartRecordOptions | undefined"
|
|
40
|
+
}
|
|
41
|
+
],
|
|
42
|
+
"returns": "Promise<void>",
|
|
43
|
+
"tags": [],
|
|
44
|
+
"docs": "Start recording audio",
|
|
45
|
+
"complexTypes": [
|
|
46
|
+
"StartRecordOptions"
|
|
47
|
+
],
|
|
48
|
+
"slug": "startrecord"
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
"name": "stopRecord",
|
|
52
|
+
"signature": "() => Promise<StopRecordResult>",
|
|
53
|
+
"parameters": [],
|
|
54
|
+
"returns": "Promise<StopRecordResult>",
|
|
55
|
+
"tags": [],
|
|
56
|
+
"docs": "Stop recording and return the recorded file path",
|
|
57
|
+
"complexTypes": [
|
|
58
|
+
"StopRecordResult"
|
|
59
|
+
],
|
|
60
|
+
"slug": "stoprecord"
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
"name": "pauseRecord",
|
|
64
|
+
"signature": "() => Promise<void>",
|
|
65
|
+
"parameters": [],
|
|
66
|
+
"returns": "Promise<void>",
|
|
67
|
+
"tags": [],
|
|
68
|
+
"docs": "Pause the current recording",
|
|
69
|
+
"complexTypes": [],
|
|
70
|
+
"slug": "pauserecord"
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
"name": "resumeRecord",
|
|
74
|
+
"signature": "() => Promise<void>",
|
|
75
|
+
"parameters": [],
|
|
76
|
+
"returns": "Promise<void>",
|
|
77
|
+
"tags": [],
|
|
78
|
+
"docs": "Resume a paused recording",
|
|
79
|
+
"complexTypes": [],
|
|
80
|
+
"slug": "resumerecord"
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
"name": "preparePlay",
|
|
84
|
+
"signature": "(options: PlayOptions) => Promise<PreparePlayResult>",
|
|
85
|
+
"parameters": [
|
|
86
|
+
{
|
|
87
|
+
"name": "options",
|
|
88
|
+
"docs": "",
|
|
89
|
+
"type": "PlayOptions"
|
|
90
|
+
}
|
|
91
|
+
],
|
|
92
|
+
"returns": "Promise<PreparePlayResult>",
|
|
93
|
+
"tags": [],
|
|
94
|
+
"docs": "Prepare an audio file for playback (loads metadata without playing).\nReturns a playerId that must be used for all subsequent operations on this player.",
|
|
95
|
+
"complexTypes": [
|
|
96
|
+
"PreparePlayResult",
|
|
97
|
+
"PlayOptions"
|
|
98
|
+
],
|
|
99
|
+
"slug": "prepareplay"
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
"name": "play",
|
|
103
|
+
"signature": "(options: PlayerOptions) => Promise<void>",
|
|
104
|
+
"parameters": [
|
|
105
|
+
{
|
|
106
|
+
"name": "options",
|
|
107
|
+
"docs": "",
|
|
108
|
+
"type": "PlayerOptions"
|
|
109
|
+
}
|
|
110
|
+
],
|
|
111
|
+
"returns": "Promise<void>",
|
|
112
|
+
"tags": [],
|
|
113
|
+
"docs": "Start playing an audio file",
|
|
114
|
+
"complexTypes": [
|
|
115
|
+
"PlayerOptions"
|
|
116
|
+
],
|
|
117
|
+
"slug": "play"
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
"name": "pausePlay",
|
|
121
|
+
"signature": "(options: PlayerOptions) => Promise<void>",
|
|
122
|
+
"parameters": [
|
|
123
|
+
{
|
|
124
|
+
"name": "options",
|
|
125
|
+
"docs": "",
|
|
126
|
+
"type": "PlayerOptions"
|
|
127
|
+
}
|
|
128
|
+
],
|
|
129
|
+
"returns": "Promise<void>",
|
|
130
|
+
"tags": [],
|
|
131
|
+
"docs": "Pause audio playback",
|
|
132
|
+
"complexTypes": [
|
|
133
|
+
"PlayerOptions"
|
|
134
|
+
],
|
|
135
|
+
"slug": "pauseplay"
|
|
136
|
+
},
|
|
137
|
+
{
|
|
138
|
+
"name": "resumePlay",
|
|
139
|
+
"signature": "(options: PlayerOptions) => Promise<void>",
|
|
140
|
+
"parameters": [
|
|
141
|
+
{
|
|
142
|
+
"name": "options",
|
|
143
|
+
"docs": "",
|
|
144
|
+
"type": "PlayerOptions"
|
|
145
|
+
}
|
|
146
|
+
],
|
|
147
|
+
"returns": "Promise<void>",
|
|
148
|
+
"tags": [],
|
|
149
|
+
"docs": "Resume paused audio playback",
|
|
150
|
+
"complexTypes": [
|
|
151
|
+
"PlayerOptions"
|
|
152
|
+
],
|
|
153
|
+
"slug": "resumeplay"
|
|
154
|
+
},
|
|
155
|
+
{
|
|
156
|
+
"name": "stopPlay",
|
|
157
|
+
"signature": "(options: PlayerOptions) => Promise<void>",
|
|
158
|
+
"parameters": [
|
|
159
|
+
{
|
|
160
|
+
"name": "options",
|
|
161
|
+
"docs": "",
|
|
162
|
+
"type": "PlayerOptions"
|
|
163
|
+
}
|
|
164
|
+
],
|
|
165
|
+
"returns": "Promise<void>",
|
|
166
|
+
"tags": [],
|
|
167
|
+
"docs": "Stop audio playback",
|
|
168
|
+
"complexTypes": [
|
|
169
|
+
"PlayerOptions"
|
|
170
|
+
],
|
|
171
|
+
"slug": "stopplay"
|
|
172
|
+
},
|
|
173
|
+
{
|
|
174
|
+
"name": "seekTo",
|
|
175
|
+
"signature": "(options: SeekOptions) => Promise<void>",
|
|
176
|
+
"parameters": [
|
|
177
|
+
{
|
|
178
|
+
"name": "options",
|
|
179
|
+
"docs": "",
|
|
180
|
+
"type": "SeekOptions"
|
|
181
|
+
}
|
|
182
|
+
],
|
|
183
|
+
"returns": "Promise<void>",
|
|
184
|
+
"tags": [],
|
|
185
|
+
"docs": "Seek to a specific position in the audio",
|
|
186
|
+
"complexTypes": [
|
|
187
|
+
"SeekOptions"
|
|
188
|
+
],
|
|
189
|
+
"slug": "seekto"
|
|
190
|
+
},
|
|
191
|
+
{
|
|
192
|
+
"name": "getPlaybackStatus",
|
|
193
|
+
"signature": "(options: PlayerOptions) => Promise<PlaybackStatusChangeEvent>",
|
|
194
|
+
"parameters": [
|
|
195
|
+
{
|
|
196
|
+
"name": "options",
|
|
197
|
+
"docs": "",
|
|
198
|
+
"type": "PlayerOptions"
|
|
199
|
+
}
|
|
200
|
+
],
|
|
201
|
+
"returns": "Promise<PlaybackStatusChangeEvent>",
|
|
202
|
+
"tags": [],
|
|
203
|
+
"docs": "Get current playback status for a specific player",
|
|
204
|
+
"complexTypes": [
|
|
205
|
+
"PlaybackStatusChangeEvent",
|
|
206
|
+
"PlayerOptions"
|
|
207
|
+
],
|
|
208
|
+
"slug": "getplaybackstatus"
|
|
209
|
+
},
|
|
210
|
+
{
|
|
211
|
+
"name": "getRecordingStatus",
|
|
212
|
+
"signature": "() => Promise<RecordingStatusChangeEvent>",
|
|
213
|
+
"parameters": [],
|
|
214
|
+
"returns": "Promise<RecordingStatusChangeEvent>",
|
|
215
|
+
"tags": [],
|
|
216
|
+
"docs": "Get current recording status",
|
|
217
|
+
"complexTypes": [
|
|
218
|
+
"RecordingStatusChangeEvent"
|
|
219
|
+
],
|
|
220
|
+
"slug": "getrecordingstatus"
|
|
221
|
+
},
|
|
222
|
+
{
|
|
223
|
+
"name": "destroyPlayer",
|
|
224
|
+
"signature": "(options: PlayerOptions) => Promise<void>",
|
|
225
|
+
"parameters": [
|
|
226
|
+
{
|
|
227
|
+
"name": "options",
|
|
228
|
+
"docs": "",
|
|
229
|
+
"type": "PlayerOptions"
|
|
230
|
+
}
|
|
231
|
+
],
|
|
232
|
+
"returns": "Promise<void>",
|
|
233
|
+
"tags": [],
|
|
234
|
+
"docs": "Destroy a player and release its resources",
|
|
235
|
+
"complexTypes": [
|
|
236
|
+
"PlayerOptions"
|
|
237
|
+
],
|
|
238
|
+
"slug": "destroyplayer"
|
|
239
|
+
},
|
|
240
|
+
{
|
|
241
|
+
"name": "addListener",
|
|
242
|
+
"signature": "(eventName: 'recordingStatusChange', listenerFunc: (event: RecordingStatusChangeEvent) => void) => Promise<PluginListenerHandle>",
|
|
243
|
+
"parameters": [
|
|
244
|
+
{
|
|
245
|
+
"name": "eventName",
|
|
246
|
+
"docs": "",
|
|
247
|
+
"type": "'recordingStatusChange'"
|
|
248
|
+
},
|
|
249
|
+
{
|
|
250
|
+
"name": "listenerFunc",
|
|
251
|
+
"docs": "",
|
|
252
|
+
"type": "(event: RecordingStatusChangeEvent) => void"
|
|
253
|
+
}
|
|
254
|
+
],
|
|
255
|
+
"returns": "Promise<PluginListenerHandle>",
|
|
256
|
+
"tags": [],
|
|
257
|
+
"docs": "Listen for recording status changes",
|
|
258
|
+
"complexTypes": [
|
|
259
|
+
"PluginListenerHandle",
|
|
260
|
+
"RecordingStatusChangeEvent"
|
|
261
|
+
],
|
|
262
|
+
"slug": "addlistenerrecordingstatuschange-"
|
|
263
|
+
},
|
|
264
|
+
{
|
|
265
|
+
"name": "addListener",
|
|
266
|
+
"signature": "(eventName: 'playbackStatusChange', listenerFunc: (event: PlaybackStatusChangeEvent) => void) => Promise<PluginListenerHandle>",
|
|
267
|
+
"parameters": [
|
|
268
|
+
{
|
|
269
|
+
"name": "eventName",
|
|
270
|
+
"docs": "",
|
|
271
|
+
"type": "'playbackStatusChange'"
|
|
272
|
+
},
|
|
273
|
+
{
|
|
274
|
+
"name": "listenerFunc",
|
|
275
|
+
"docs": "",
|
|
276
|
+
"type": "(event: PlaybackStatusChangeEvent) => void"
|
|
277
|
+
}
|
|
278
|
+
],
|
|
279
|
+
"returns": "Promise<PluginListenerHandle>",
|
|
280
|
+
"tags": [],
|
|
281
|
+
"docs": "Listen for playback status changes (includes playerId to identify which player)",
|
|
282
|
+
"complexTypes": [
|
|
283
|
+
"PluginListenerHandle",
|
|
284
|
+
"PlaybackStatusChangeEvent"
|
|
285
|
+
],
|
|
286
|
+
"slug": "addlistenerplaybackstatuschange-"
|
|
287
|
+
},
|
|
288
|
+
{
|
|
289
|
+
"name": "removeAllListeners",
|
|
290
|
+
"signature": "() => Promise<void>",
|
|
291
|
+
"parameters": [],
|
|
292
|
+
"returns": "Promise<void>",
|
|
293
|
+
"tags": [],
|
|
294
|
+
"docs": "Remove all listeners",
|
|
295
|
+
"complexTypes": [],
|
|
296
|
+
"slug": "removealllisteners"
|
|
297
|
+
}
|
|
298
|
+
],
|
|
299
|
+
"properties": []
|
|
300
|
+
},
|
|
301
|
+
"interfaces": [
|
|
302
|
+
{
|
|
303
|
+
"name": "PermissionStatus",
|
|
304
|
+
"slug": "permissionstatus",
|
|
305
|
+
"docs": "",
|
|
306
|
+
"tags": [],
|
|
307
|
+
"methods": [],
|
|
308
|
+
"properties": [
|
|
309
|
+
{
|
|
310
|
+
"name": "microphone",
|
|
311
|
+
"tags": [],
|
|
312
|
+
"docs": "",
|
|
313
|
+
"complexTypes": [],
|
|
314
|
+
"type": "'granted' | 'denied' | 'prompt'"
|
|
315
|
+
}
|
|
316
|
+
]
|
|
317
|
+
},
|
|
318
|
+
{
|
|
319
|
+
"name": "StartRecordOptions",
|
|
320
|
+
"slug": "startrecordoptions",
|
|
321
|
+
"docs": "",
|
|
322
|
+
"tags": [],
|
|
323
|
+
"methods": [],
|
|
324
|
+
"properties": [
|
|
325
|
+
{
|
|
326
|
+
"name": "path",
|
|
327
|
+
"tags": [],
|
|
328
|
+
"docs": "Optional relative path for the recording (including extension), relative to the app's data directory. If not provided, a default filename will be used.",
|
|
329
|
+
"complexTypes": [],
|
|
330
|
+
"type": "string | undefined"
|
|
331
|
+
}
|
|
332
|
+
]
|
|
333
|
+
},
|
|
334
|
+
{
|
|
335
|
+
"name": "StopRecordResult",
|
|
336
|
+
"slug": "stoprecordresult",
|
|
337
|
+
"docs": "",
|
|
338
|
+
"tags": [],
|
|
339
|
+
"methods": [],
|
|
340
|
+
"properties": [
|
|
341
|
+
{
|
|
342
|
+
"name": "path",
|
|
343
|
+
"tags": [],
|
|
344
|
+
"docs": "Path to the recorded file",
|
|
345
|
+
"complexTypes": [],
|
|
346
|
+
"type": "string"
|
|
347
|
+
},
|
|
348
|
+
{
|
|
349
|
+
"name": "duration",
|
|
350
|
+
"tags": [],
|
|
351
|
+
"docs": "Duration of the recording in milliseconds",
|
|
352
|
+
"complexTypes": [],
|
|
353
|
+
"type": "number"
|
|
354
|
+
}
|
|
355
|
+
]
|
|
356
|
+
},
|
|
357
|
+
{
|
|
358
|
+
"name": "PreparePlayResult",
|
|
359
|
+
"slug": "prepareplayresult",
|
|
360
|
+
"docs": "",
|
|
361
|
+
"tags": [],
|
|
362
|
+
"methods": [],
|
|
363
|
+
"properties": [
|
|
364
|
+
{
|
|
365
|
+
"name": "playerId",
|
|
366
|
+
"tags": [],
|
|
367
|
+
"docs": "Unique identifier for this player instance",
|
|
368
|
+
"complexTypes": [],
|
|
369
|
+
"type": "string"
|
|
370
|
+
},
|
|
371
|
+
{
|
|
372
|
+
"name": "duration",
|
|
373
|
+
"tags": [],
|
|
374
|
+
"docs": "Duration of the audio in milliseconds",
|
|
375
|
+
"complexTypes": [],
|
|
376
|
+
"type": "number"
|
|
377
|
+
}
|
|
378
|
+
]
|
|
379
|
+
},
|
|
380
|
+
{
|
|
381
|
+
"name": "PlayOptions",
|
|
382
|
+
"slug": "playoptions",
|
|
383
|
+
"docs": "",
|
|
384
|
+
"tags": [],
|
|
385
|
+
"methods": [],
|
|
386
|
+
"properties": [
|
|
387
|
+
{
|
|
388
|
+
"name": "path",
|
|
389
|
+
"tags": [],
|
|
390
|
+
"docs": "Relative path to the audio file to play (relative to the app's data directory)",
|
|
391
|
+
"complexTypes": [],
|
|
392
|
+
"type": "string"
|
|
393
|
+
}
|
|
394
|
+
]
|
|
395
|
+
},
|
|
396
|
+
{
|
|
397
|
+
"name": "PlayerOptions",
|
|
398
|
+
"slug": "playeroptions",
|
|
399
|
+
"docs": "",
|
|
400
|
+
"tags": [],
|
|
401
|
+
"methods": [],
|
|
402
|
+
"properties": [
|
|
403
|
+
{
|
|
404
|
+
"name": "playerId",
|
|
405
|
+
"tags": [],
|
|
406
|
+
"docs": "The player ID returned from preparePlay",
|
|
407
|
+
"complexTypes": [],
|
|
408
|
+
"type": "string"
|
|
409
|
+
}
|
|
410
|
+
]
|
|
411
|
+
},
|
|
412
|
+
{
|
|
413
|
+
"name": "SeekOptions",
|
|
414
|
+
"slug": "seekoptions",
|
|
415
|
+
"docs": "",
|
|
416
|
+
"tags": [],
|
|
417
|
+
"methods": [],
|
|
418
|
+
"properties": [
|
|
419
|
+
{
|
|
420
|
+
"name": "playerId",
|
|
421
|
+
"tags": [],
|
|
422
|
+
"docs": "The player ID returned from preparePlay",
|
|
423
|
+
"complexTypes": [],
|
|
424
|
+
"type": "string"
|
|
425
|
+
},
|
|
426
|
+
{
|
|
427
|
+
"name": "position",
|
|
428
|
+
"tags": [],
|
|
429
|
+
"docs": "Position to seek to in milliseconds",
|
|
430
|
+
"complexTypes": [],
|
|
431
|
+
"type": "number"
|
|
432
|
+
}
|
|
433
|
+
]
|
|
434
|
+
},
|
|
435
|
+
{
|
|
436
|
+
"name": "PlaybackStatusChangeEvent",
|
|
437
|
+
"slug": "playbackstatuschangeevent",
|
|
438
|
+
"docs": "",
|
|
439
|
+
"tags": [],
|
|
440
|
+
"methods": [],
|
|
441
|
+
"properties": [
|
|
442
|
+
{
|
|
443
|
+
"name": "playerId",
|
|
444
|
+
"tags": [],
|
|
445
|
+
"docs": "The player ID this event belongs to",
|
|
446
|
+
"complexTypes": [],
|
|
447
|
+
"type": "string"
|
|
448
|
+
},
|
|
449
|
+
{
|
|
450
|
+
"name": "status",
|
|
451
|
+
"tags": [],
|
|
452
|
+
"docs": "",
|
|
453
|
+
"complexTypes": [
|
|
454
|
+
"PlaybackStatus"
|
|
455
|
+
],
|
|
456
|
+
"type": "PlaybackStatus"
|
|
457
|
+
},
|
|
458
|
+
{
|
|
459
|
+
"name": "currentPosition",
|
|
460
|
+
"tags": [],
|
|
461
|
+
"docs": "Current playback position in milliseconds",
|
|
462
|
+
"complexTypes": [],
|
|
463
|
+
"type": "number"
|
|
464
|
+
},
|
|
465
|
+
{
|
|
466
|
+
"name": "duration",
|
|
467
|
+
"tags": [],
|
|
468
|
+
"docs": "Total duration of the audio in milliseconds",
|
|
469
|
+
"complexTypes": [],
|
|
470
|
+
"type": "number"
|
|
471
|
+
}
|
|
472
|
+
]
|
|
473
|
+
},
|
|
474
|
+
{
|
|
475
|
+
"name": "RecordingStatusChangeEvent",
|
|
476
|
+
"slug": "recordingstatuschangeevent",
|
|
477
|
+
"docs": "",
|
|
478
|
+
"tags": [],
|
|
479
|
+
"methods": [],
|
|
480
|
+
"properties": [
|
|
481
|
+
{
|
|
482
|
+
"name": "status",
|
|
483
|
+
"tags": [],
|
|
484
|
+
"docs": "",
|
|
485
|
+
"complexTypes": [
|
|
486
|
+
"RecordingStatus"
|
|
487
|
+
],
|
|
488
|
+
"type": "RecordingStatus"
|
|
489
|
+
},
|
|
490
|
+
{
|
|
491
|
+
"name": "duration",
|
|
492
|
+
"tags": [],
|
|
493
|
+
"docs": "Current recording duration in milliseconds",
|
|
494
|
+
"complexTypes": [],
|
|
495
|
+
"type": "number"
|
|
496
|
+
}
|
|
497
|
+
]
|
|
498
|
+
},
|
|
499
|
+
{
|
|
500
|
+
"name": "PluginListenerHandle",
|
|
501
|
+
"slug": "pluginlistenerhandle",
|
|
502
|
+
"docs": "",
|
|
503
|
+
"tags": [],
|
|
504
|
+
"methods": [],
|
|
505
|
+
"properties": [
|
|
506
|
+
{
|
|
507
|
+
"name": "remove",
|
|
508
|
+
"tags": [],
|
|
509
|
+
"docs": "",
|
|
510
|
+
"complexTypes": [],
|
|
511
|
+
"type": "() => Promise<void>"
|
|
512
|
+
}
|
|
513
|
+
]
|
|
514
|
+
}
|
|
515
|
+
],
|
|
516
|
+
"enums": [],
|
|
517
|
+
"typeAliases": [
|
|
518
|
+
{
|
|
519
|
+
"name": "PlaybackStatus",
|
|
520
|
+
"slug": "playbackstatus",
|
|
521
|
+
"docs": "",
|
|
522
|
+
"types": [
|
|
523
|
+
{
|
|
524
|
+
"text": "'playing'",
|
|
525
|
+
"complexTypes": []
|
|
526
|
+
},
|
|
527
|
+
{
|
|
528
|
+
"text": "'paused'",
|
|
529
|
+
"complexTypes": []
|
|
530
|
+
},
|
|
531
|
+
{
|
|
532
|
+
"text": "'stopped'",
|
|
533
|
+
"complexTypes": []
|
|
534
|
+
},
|
|
535
|
+
{
|
|
536
|
+
"text": "'ended'",
|
|
537
|
+
"complexTypes": []
|
|
538
|
+
}
|
|
539
|
+
]
|
|
540
|
+
},
|
|
541
|
+
{
|
|
542
|
+
"name": "RecordingStatus",
|
|
543
|
+
"slug": "recordingstatus",
|
|
544
|
+
"docs": "",
|
|
545
|
+
"types": [
|
|
546
|
+
{
|
|
547
|
+
"text": "'recording'",
|
|
548
|
+
"complexTypes": []
|
|
549
|
+
},
|
|
550
|
+
{
|
|
551
|
+
"text": "'paused'",
|
|
552
|
+
"complexTypes": []
|
|
553
|
+
},
|
|
554
|
+
{
|
|
555
|
+
"text": "'stopped'",
|
|
556
|
+
"complexTypes": []
|
|
557
|
+
}
|
|
558
|
+
]
|
|
559
|
+
}
|
|
560
|
+
],
|
|
561
|
+
"pluginConfigs": []
|
|
562
|
+
}
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
import type { PluginListenerHandle } from '@capacitor/core';
|
|
2
|
+
export type RecordingStatus = 'recording' | 'paused' | 'stopped';
|
|
3
|
+
export type PlaybackStatus = 'playing' | 'paused' | 'stopped' | 'ended';
|
|
4
|
+
export interface StartRecordOptions {
|
|
5
|
+
/** Optional relative path for the recording (including extension), relative to the app's data directory. If not provided, a default filename will be used. */
|
|
6
|
+
path?: string;
|
|
7
|
+
}
|
|
8
|
+
export interface StopRecordResult {
|
|
9
|
+
/** Path to the recorded file */
|
|
10
|
+
path: string;
|
|
11
|
+
/** Duration of the recording in milliseconds */
|
|
12
|
+
duration: number;
|
|
13
|
+
}
|
|
14
|
+
export interface PlayOptions {
|
|
15
|
+
/** Relative path to the audio file to play (relative to the app's data directory) */
|
|
16
|
+
path: string;
|
|
17
|
+
}
|
|
18
|
+
export interface PreparePlayResult {
|
|
19
|
+
/** Unique identifier for this player instance */
|
|
20
|
+
playerId: string;
|
|
21
|
+
/** Duration of the audio in milliseconds */
|
|
22
|
+
duration: number;
|
|
23
|
+
}
|
|
24
|
+
export interface PlayerOptions {
|
|
25
|
+
/** The player ID returned from preparePlay */
|
|
26
|
+
playerId: string;
|
|
27
|
+
}
|
|
28
|
+
export interface SeekOptions {
|
|
29
|
+
/** The player ID returned from preparePlay */
|
|
30
|
+
playerId: string;
|
|
31
|
+
/** Position to seek to in milliseconds */
|
|
32
|
+
position: number;
|
|
33
|
+
}
|
|
34
|
+
export interface RecordingStatusChangeEvent {
|
|
35
|
+
status: RecordingStatus;
|
|
36
|
+
/** Current recording duration in milliseconds */
|
|
37
|
+
duration: number;
|
|
38
|
+
}
|
|
39
|
+
export interface PlaybackStatusChangeEvent {
|
|
40
|
+
/** The player ID this event belongs to */
|
|
41
|
+
playerId: string;
|
|
42
|
+
status: PlaybackStatus;
|
|
43
|
+
/** Current playback position in milliseconds */
|
|
44
|
+
currentPosition: number;
|
|
45
|
+
/** Total duration of the audio in milliseconds */
|
|
46
|
+
duration: number;
|
|
47
|
+
}
|
|
48
|
+
export interface PermissionStatus {
|
|
49
|
+
microphone: 'granted' | 'denied' | 'prompt';
|
|
50
|
+
}
|
|
51
|
+
export interface RecorderPlayerPlugin {
|
|
52
|
+
/**
|
|
53
|
+
* Request microphone permission
|
|
54
|
+
*/
|
|
55
|
+
requestPermission(): Promise<PermissionStatus>;
|
|
56
|
+
/**
|
|
57
|
+
* Check current permission status
|
|
58
|
+
*/
|
|
59
|
+
checkPermission(): Promise<PermissionStatus>;
|
|
60
|
+
/**
|
|
61
|
+
* Start recording audio
|
|
62
|
+
*/
|
|
63
|
+
startRecord(options?: StartRecordOptions): Promise<void>;
|
|
64
|
+
/**
|
|
65
|
+
* Stop recording and return the recorded file path
|
|
66
|
+
*/
|
|
67
|
+
stopRecord(): Promise<StopRecordResult>;
|
|
68
|
+
/**
|
|
69
|
+
* Pause the current recording
|
|
70
|
+
*/
|
|
71
|
+
pauseRecord(): Promise<void>;
|
|
72
|
+
/**
|
|
73
|
+
* Resume a paused recording
|
|
74
|
+
*/
|
|
75
|
+
resumeRecord(): Promise<void>;
|
|
76
|
+
/**
|
|
77
|
+
* Prepare an audio file for playback (loads metadata without playing).
|
|
78
|
+
* Returns a playerId that must be used for all subsequent operations on this player.
|
|
79
|
+
*/
|
|
80
|
+
preparePlay(options: PlayOptions): Promise<PreparePlayResult>;
|
|
81
|
+
/**
|
|
82
|
+
* Start playing an audio file
|
|
83
|
+
*/
|
|
84
|
+
play(options: PlayerOptions): Promise<void>;
|
|
85
|
+
/**
|
|
86
|
+
* Pause audio playback
|
|
87
|
+
*/
|
|
88
|
+
pausePlay(options: PlayerOptions): Promise<void>;
|
|
89
|
+
/**
|
|
90
|
+
* Resume paused audio playback
|
|
91
|
+
*/
|
|
92
|
+
resumePlay(options: PlayerOptions): Promise<void>;
|
|
93
|
+
/**
|
|
94
|
+
* Stop audio playback
|
|
95
|
+
*/
|
|
96
|
+
stopPlay(options: PlayerOptions): Promise<void>;
|
|
97
|
+
/**
|
|
98
|
+
* Seek to a specific position in the audio
|
|
99
|
+
*/
|
|
100
|
+
seekTo(options: SeekOptions): Promise<void>;
|
|
101
|
+
/**
|
|
102
|
+
* Get current playback status for a specific player
|
|
103
|
+
*/
|
|
104
|
+
getPlaybackStatus(options: PlayerOptions): Promise<PlaybackStatusChangeEvent>;
|
|
105
|
+
/**
|
|
106
|
+
* Get current recording status
|
|
107
|
+
*/
|
|
108
|
+
getRecordingStatus(): Promise<RecordingStatusChangeEvent>;
|
|
109
|
+
/**
|
|
110
|
+
* Destroy a player and release its resources
|
|
111
|
+
*/
|
|
112
|
+
destroyPlayer(options: PlayerOptions): Promise<void>;
|
|
113
|
+
/**
|
|
114
|
+
* Listen for recording status changes
|
|
115
|
+
*/
|
|
116
|
+
addListener(eventName: 'recordingStatusChange', listenerFunc: (event: RecordingStatusChangeEvent) => void): Promise<PluginListenerHandle>;
|
|
117
|
+
/**
|
|
118
|
+
* Listen for playback status changes (includes playerId to identify which player)
|
|
119
|
+
*/
|
|
120
|
+
addListener(eventName: 'playbackStatusChange', listenerFunc: (event: PlaybackStatusChangeEvent) => void): Promise<PluginListenerHandle>;
|
|
121
|
+
/**
|
|
122
|
+
* Remove all listeners
|
|
123
|
+
*/
|
|
124
|
+
removeAllListeners(): Promise<void>;
|
|
125
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"definitions.js","sourceRoot":"","sources":["../../src/definitions.ts"],"names":[],"mappings":"","sourcesContent":["import type { PluginListenerHandle } from '@capacitor/core';\n\nexport type RecordingStatus = 'recording' | 'paused' | 'stopped';\nexport type PlaybackStatus = 'playing' | 'paused' | 'stopped' | 'ended';\n\nexport interface StartRecordOptions {\n /** Optional relative path for the recording (including extension), relative to the app's data directory. If not provided, a default filename will be used. */\n path?: string;\n}\n\nexport interface StopRecordResult {\n /** Path to the recorded file */\n path: string;\n /** Duration of the recording in milliseconds */\n duration: number;\n}\n\nexport interface PlayOptions {\n /** Relative path to the audio file to play (relative to the app's data directory) */\n path: string;\n}\n\nexport interface PreparePlayResult {\n /** Unique identifier for this player instance */\n playerId: string;\n /** Duration of the audio in milliseconds */\n duration: number;\n}\n\nexport interface PlayerOptions {\n /** The player ID returned from preparePlay */\n playerId: string;\n}\n\nexport interface SeekOptions {\n /** The player ID returned from preparePlay */\n playerId: string;\n /** Position to seek to in milliseconds */\n position: number;\n}\n\nexport interface RecordingStatusChangeEvent {\n status: RecordingStatus;\n /** Current recording duration in milliseconds */\n duration: number;\n}\n\nexport interface PlaybackStatusChangeEvent {\n /** The player ID this event belongs to */\n playerId: string;\n status: PlaybackStatus;\n /** Current playback position in milliseconds */\n currentPosition: number;\n /** Total duration of the audio in milliseconds */\n duration: number;\n}\n\nexport interface PermissionStatus {\n microphone: 'granted' | 'denied' | 'prompt';\n}\n\nexport interface RecorderPlayerPlugin {\n /**\n * Request microphone permission\n */\n requestPermission(): Promise<PermissionStatus>;\n\n /**\n * Check current permission status\n */\n checkPermission(): Promise<PermissionStatus>;\n\n /**\n * Start recording audio\n */\n startRecord(options?: StartRecordOptions): Promise<void>;\n\n /**\n * Stop recording and return the recorded file path\n */\n stopRecord(): Promise<StopRecordResult>;\n\n /**\n * Pause the current recording\n */\n pauseRecord(): Promise<void>;\n\n /**\n * Resume a paused recording\n */\n resumeRecord(): Promise<void>;\n\n /**\n * Prepare an audio file for playback (loads metadata without playing).\n * Returns a playerId that must be used for all subsequent operations on this player.\n */\n preparePlay(options: PlayOptions): Promise<PreparePlayResult>;\n\n /**\n * Start playing an audio file\n */\n play(options: PlayerOptions): Promise<void>;\n\n /**\n * Pause audio playback\n */\n pausePlay(options: PlayerOptions): Promise<void>;\n\n /**\n * Resume paused audio playback\n */\n resumePlay(options: PlayerOptions): Promise<void>;\n\n /**\n * Stop audio playback\n */\n stopPlay(options: PlayerOptions): Promise<void>;\n\n /**\n * Seek to a specific position in the audio\n */\n seekTo(options: SeekOptions): Promise<void>;\n\n /**\n * Get current playback status for a specific player\n */\n getPlaybackStatus(options: PlayerOptions): Promise<PlaybackStatusChangeEvent>;\n\n /**\n * Get current recording status\n */\n getRecordingStatus(): Promise<RecordingStatusChangeEvent>;\n\n /**\n * Destroy a player and release its resources\n */\n destroyPlayer(options: PlayerOptions): Promise<void>;\n\n /**\n * Listen for recording status changes\n */\n addListener(\n eventName: 'recordingStatusChange',\n listenerFunc: (event: RecordingStatusChangeEvent) => void\n ): Promise<PluginListenerHandle>;\n\n /**\n * Listen for playback status changes (includes playerId to identify which player)\n */\n addListener(\n eventName: 'playbackStatusChange',\n listenerFunc: (event: PlaybackStatusChangeEvent) => void\n ): Promise<PluginListenerHandle>;\n\n /**\n * Remove all listeners\n */\n removeAllListeners(): Promise<void>;\n}\n"]}
|