@mustafaj/capacitor-plugin-playlist 0.9.0 → 0.9.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/CHANGELOG.md ADDED
@@ -0,0 +1,9 @@
1
+ # Changelog
2
+
3
+ ## 0.9.0
4
+
5
+ ### Breaking Changes
6
+
7
+ - Low-level `Playlist.removeItem()` and `Playlist.removeItems()` now accept only `id` / `index`.
8
+ - If you were calling the raw Capacitor plugin API with `trackId` / `trackIndex`, update those calls to `id` / `index`.
9
+ - The higher-level `RmxAudioPlayer` wrapper still accepts `trackId` / `trackIndex` and maps them to the canonical plugin contract.
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "@mustafaj/capacitor-plugin-playlist",
3
- "version": "0.9.0",
3
+ "version": "0.9.1",
4
4
  "description": "Capacitor audio playlist plugin with Android, iOS, and web support",
5
- "main": "dist/plugin.cjs.js",
6
5
  "module": "dist/esm/index.js",
7
6
  "types": "dist/esm/index.d.ts",
8
7
  "unpkg": "dist/plugin.js",
9
8
  "files": [
10
9
  "dist/",
10
+ "CHANGELOG.md",
11
11
  "ios/",
12
12
  "android/",
13
13
  "CapacitorPluginPlaylist.podspec"
@@ -74,12 +74,12 @@
74
74
  },
75
75
  "repository": {
76
76
  "type": "git",
77
- "url": "git+https://github.com/mustafaj/capacitor-plugin-playlist.git"
77
+ "url": "git+https://github.com/mustafa0x/capacitor-plugin-playlist.git"
78
78
  },
79
79
  "bugs": {
80
- "url": "https://github.com/mustafaj/capacitor-plugin-playlist/issues"
80
+ "url": "https://github.com/mustafa0x/capacitor-plugin-playlist/issues"
81
81
  },
82
- "homepage": "https://github.com/mustafaj/capacitor-plugin-playlist#readme",
82
+ "homepage": "https://github.com/mustafa0x/capacitor-plugin-playlist#readme",
83
83
  "publishConfig": {
84
84
  "access": "public"
85
85
  },
@@ -1,993 +0,0 @@
1
- 'use strict';
2
-
3
- var core = require('@capacitor/core');
4
-
5
- /**
6
- * Enum describing the possible errors that may come from the plugins
7
- */
8
- exports.RmxAudioErrorType = void 0;
9
- (function (RmxAudioErrorType) {
10
- RmxAudioErrorType[RmxAudioErrorType["RMXERR_NONE_ACTIVE"] = 0] = "RMXERR_NONE_ACTIVE";
11
- RmxAudioErrorType[RmxAudioErrorType["RMXERR_ABORTED"] = 1] = "RMXERR_ABORTED";
12
- RmxAudioErrorType[RmxAudioErrorType["RMXERR_NETWORK"] = 2] = "RMXERR_NETWORK";
13
- RmxAudioErrorType[RmxAudioErrorType["RMXERR_DECODE"] = 3] = "RMXERR_DECODE";
14
- RmxAudioErrorType[RmxAudioErrorType["RMXERR_NONE_SUPPORTED"] = 4] = "RMXERR_NONE_SUPPORTED";
15
- })(exports.RmxAudioErrorType || (exports.RmxAudioErrorType = {}));
16
- /**
17
- * String descriptions corresponding to the RmxAudioErrorType values
18
- */
19
- const RmxAudioErrorTypeDescriptions = [
20
- 'No Active Sources',
21
- 'Aborted',
22
- 'Network',
23
- 'Failed to Decode',
24
- 'No Supported Sources',
25
- ];
26
- /**
27
- * Enumeration of all status messages raised by the plugin.
28
- * NONE, REGISTER and INIT are structural and probably not useful to you.
29
- */
30
- exports.RmxAudioStatusMessage = void 0;
31
- (function (RmxAudioStatusMessage) {
32
- /**
33
- * The starting state of the plugin. You will never see this value;
34
- * it changes before the callbacks are even registered to report changes to this value.
35
- */
36
- RmxAudioStatusMessage[RmxAudioStatusMessage["RMXSTATUS_NONE"] = 0] = "RMXSTATUS_NONE";
37
- /**
38
- * Raised when the plugin registers the callback handler for onStatus callbacks.
39
- * You will probably not be able to see this (nor do you need to).
40
- */
41
- RmxAudioStatusMessage[RmxAudioStatusMessage["RMXSTATUS_REGISTER"] = 1] = "RMXSTATUS_REGISTER";
42
- /**
43
- * Reserved for future use
44
- */
45
- RmxAudioStatusMessage[RmxAudioStatusMessage["RMXSTATUS_INIT"] = 2] = "RMXSTATUS_INIT";
46
- /**
47
- * Indicates an error is reported in the 'value' field.
48
- */
49
- RmxAudioStatusMessage[RmxAudioStatusMessage["RMXSTATUS_ERROR"] = 5] = "RMXSTATUS_ERROR";
50
- /**
51
- * The reported track is being loaded by the player
52
- */
53
- RmxAudioStatusMessage[RmxAudioStatusMessage["RMXSTATUS_LOADING"] = 10] = "RMXSTATUS_LOADING";
54
- /**
55
- * The reported track is able to begin playback
56
- */
57
- RmxAudioStatusMessage[RmxAudioStatusMessage["RMXSTATUS_CANPLAY"] = 11] = "RMXSTATUS_CANPLAY";
58
- /**
59
- * The reported track has loaded 100% of the file (either from disc or network)
60
- */
61
- RmxAudioStatusMessage[RmxAudioStatusMessage["RMXSTATUS_LOADED"] = 15] = "RMXSTATUS_LOADED";
62
- /**
63
- * (iOS only): Playback has stalled due to insufficient network
64
- */
65
- RmxAudioStatusMessage[RmxAudioStatusMessage["RMXSTATUS_STALLED"] = 20] = "RMXSTATUS_STALLED";
66
- /**
67
- * Reports an update in the reported track's buffering status
68
- */
69
- RmxAudioStatusMessage[RmxAudioStatusMessage["RMXSTATUS_BUFFERING"] = 25] = "RMXSTATUS_BUFFERING";
70
- /**
71
- * The reported track has started (or resumed) playing
72
- */
73
- RmxAudioStatusMessage[RmxAudioStatusMessage["RMXSTATUS_PLAYING"] = 30] = "RMXSTATUS_PLAYING";
74
- /**
75
- * The reported track has been paused, either by the user or by the system.
76
- * (iOS only): This value is raised when MP3's are malformed (but still playable).
77
- * These require the user to explicitly press play again. This can be worked
78
- * around and is on the TODO list.
79
- */
80
- RmxAudioStatusMessage[RmxAudioStatusMessage["RMXSTATUS_PAUSE"] = 35] = "RMXSTATUS_PAUSE";
81
- /**
82
- * Reports a change in the reported track's playback position.
83
- */
84
- RmxAudioStatusMessage[RmxAudioStatusMessage["RMXSTATUS_PLAYBACK_POSITION"] = 40] = "RMXSTATUS_PLAYBACK_POSITION";
85
- /**
86
- * The reported track has seeked.
87
- * On Android, only the plugin consumer can generate this (Notification controls on Android do not include a seek bar).
88
- * On iOS, the Command Center includes a seek bar so this will be reported when the user has seeked via Command Center.
89
- */
90
- RmxAudioStatusMessage[RmxAudioStatusMessage["RMXSTATUS_SEEK"] = 45] = "RMXSTATUS_SEEK";
91
- /**
92
- * The reported track has completed playback.
93
- */
94
- RmxAudioStatusMessage[RmxAudioStatusMessage["RMXSTATUS_COMPLETED"] = 50] = "RMXSTATUS_COMPLETED";
95
- /**
96
- * The reported track's duration has changed. This is raised once, when duration is updated for the first time.
97
- * For streams, this value is never reported.
98
- */
99
- RmxAudioStatusMessage[RmxAudioStatusMessage["RMXSTATUS_DURATION"] = 55] = "RMXSTATUS_DURATION";
100
- /**
101
- * All playback has stopped, probably because the plugin is shutting down.
102
- */
103
- RmxAudioStatusMessage[RmxAudioStatusMessage["RMXSTATUS_STOPPED"] = 60] = "RMXSTATUS_STOPPED";
104
- /**
105
- * The playlist has skipped forward to the next track.
106
- * On both Android and iOS, this will be raised if the notification controls/Command Center were used to skip.
107
- * It is unlikely you need to consume this event: RMXSTATUS_TRACK_CHANGED is also reported when this occurs,
108
- * so you can generalize your track change handling in one place.
109
- */
110
- RmxAudioStatusMessage[RmxAudioStatusMessage["RMX_STATUS_SKIP_FORWARD"] = 90] = "RMX_STATUS_SKIP_FORWARD";
111
- /**
112
- * The playlist has skipped back to the previous track.
113
- * On both Android and iOS, this will be raised if the notification controls/Command Center were used to skip.
114
- * It is unlikely you need to consume this event: RMXSTATUS_TRACK_CHANGED is also reported when this occurs,
115
- * so you can generalize your track change handling in one place.
116
- */
117
- RmxAudioStatusMessage[RmxAudioStatusMessage["RMX_STATUS_SKIP_BACK"] = 95] = "RMX_STATUS_SKIP_BACK";
118
- /**
119
- * Reported when the current track has changed in the native player. This event contains full data about
120
- * the new track, including the index and the actual track itself. The type of the 'value' field in this case
121
- * is OnStatusTrackChangedData.
122
- */
123
- RmxAudioStatusMessage[RmxAudioStatusMessage["RMXSTATUS_TRACK_CHANGED"] = 100] = "RMXSTATUS_TRACK_CHANGED";
124
- /**
125
- * The entire playlist has completed playback.
126
- * After this event has been raised, the current item is set to null and the current index to -1.
127
- */
128
- RmxAudioStatusMessage[RmxAudioStatusMessage["RMXSTATUS_PLAYLIST_COMPLETED"] = 105] = "RMXSTATUS_PLAYLIST_COMPLETED";
129
- /**
130
- * An item has been added to the playlist. For the setPlaylistItems and addAllItems methods, this status is
131
- * raised once for every track in the collection.
132
- */
133
- RmxAudioStatusMessage[RmxAudioStatusMessage["RMXSTATUS_ITEM_ADDED"] = 110] = "RMXSTATUS_ITEM_ADDED";
134
- /**
135
- * An item has been removed from the playlist. For the removeItems and clearAllItems methods, this status is
136
- * raised once for every track that was removed.
137
- */
138
- RmxAudioStatusMessage[RmxAudioStatusMessage["RMXSTATUS_ITEM_REMOVED"] = 115] = "RMXSTATUS_ITEM_REMOVED";
139
- /**
140
- * All items have been removed from the playlist
141
- */
142
- RmxAudioStatusMessage[RmxAudioStatusMessage["RMXSTATUS_PLAYLIST_CLEARED"] = 120] = "RMXSTATUS_PLAYLIST_CLEARED";
143
- /**
144
- * Just for testing.. you don't need this and in fact can never receive it, the plugin is destroyed before it can be raised.
145
- */
146
- RmxAudioStatusMessage[RmxAudioStatusMessage["RMXSTATUS_VIEWDISAPPEAR"] = 200] = "RMXSTATUS_VIEWDISAPPEAR";
147
- })(exports.RmxAudioStatusMessage || (exports.RmxAudioStatusMessage = {}));
148
- /**
149
- * String descriptions corresponding to the RmxAudioStatusMessage values
150
- */
151
- const RmxAudioStatusMessageDescriptions = {
152
- 0: 'No Status',
153
- 1: 'Plugin Registered',
154
- 2: 'Plugin Initialized',
155
- 5: 'Error',
156
- 10: 'Loading',
157
- 11: 'CanPlay',
158
- 15: 'Loaded',
159
- 20: 'Stalled',
160
- 25: 'Buffering',
161
- 30: 'Playing',
162
- 35: 'Paused',
163
- 40: 'Playback Position Changed',
164
- 45: 'Seeked',
165
- 50: 'Playback Completed',
166
- 55: 'Duration Changed',
167
- 60: 'Stopped',
168
- 90: 'Skip Forward',
169
- 95: 'Skip Backward',
170
- 100: 'Track Changed',
171
- 105: 'Playlist Completed',
172
- 110: 'Track Added',
173
- 115: 'Track Removed',
174
- 120: 'Playlist Cleared',
175
- 200: 'DEBUG_View_Disappeared',
176
- };
177
-
178
- // todo: find out why we get imported twice
179
- let playListWebInstance;
180
- const Playlist = core.registerPlugin('Playlist', {
181
- web: () => Promise.resolve().then(function () { return web; }).then(m => {
182
- if (!playListWebInstance) {
183
- playListWebInstance = new m.PlaylistWeb();
184
- }
185
- return playListWebInstance;
186
- }),
187
- });
188
-
189
- /**
190
- * Validates the list of AudioTrack items to ensure they are valid.
191
- * Used internally but you can call this if you need to :)
192
- *
193
- * @param items The AudioTrack items to validate
194
- */
195
- const validateTracks = (items) => {
196
- if (!items || !Array.isArray(items)) {
197
- return [];
198
- }
199
- return items.map(validateTrack).filter(x => !!x); // may produce an empty array!
200
- };
201
- /**
202
- * Validate a single track and ensure it is valid for playback.
203
- * Used internally but you can call this if you need to :)
204
- *
205
- * @param track The AudioTrack to validate
206
- */
207
- const validateTrack = (track) => {
208
- if (!track) {
209
- return null;
210
- }
211
- // For now we will rely on TS to do the heavy lifting, but we can add a validation here
212
- // that all the required fields are valid. For now we just take care of the unique ID.
213
- track.trackId = track.trackId || generateUUID();
214
- return track;
215
- };
216
- /**
217
- * Generate a v4 UUID for use as a unique trackId. Used internally, but you can use this to generate track ID's if you want.
218
- */
219
- const generateUUID = () => {
220
- var d = new Date().getTime();
221
- if (typeof performance !== 'undefined' && typeof performance.now === 'function') {
222
- d += performance.now(); //use high-precision timer if available
223
- }
224
- // There are better ways to do this in ES6, we are intentionally avoiding the import
225
- // of an ES6 polyfill here.
226
- const template = 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx';
227
- return [].slice.call(template).map(function (c) {
228
- if (c === '-' || c === '4') {
229
- return c;
230
- }
231
- var r = (d + Math.random() * 16) % 16 | 0;
232
- d = Math.floor(d / 16);
233
- return (c === 'x' ? r : (r & 0x3 | 0x8)).toString(16);
234
- }).join('');
235
- };
236
-
237
- /*!
238
- * Module dependencies.
239
- */
240
- const itemStatusChangeTypes = [
241
- exports.RmxAudioStatusMessage.RMXSTATUS_PLAYBACK_POSITION,
242
- exports.RmxAudioStatusMessage.RMXSTATUS_DURATION,
243
- exports.RmxAudioStatusMessage.RMXSTATUS_BUFFERING,
244
- exports.RmxAudioStatusMessage.RMXSTATUS_CANPLAY,
245
- exports.RmxAudioStatusMessage.RMXSTATUS_LOADING,
246
- exports.RmxAudioStatusMessage.RMXSTATUS_LOADED,
247
- exports.RmxAudioStatusMessage.RMXSTATUS_PAUSE,
248
- exports.RmxAudioStatusMessage.RMXSTATUS_COMPLETED,
249
- exports.RmxAudioStatusMessage.RMXSTATUS_ERROR,
250
- ];
251
- class RmxAudioPlayer {
252
- /**
253
- * The current summarized state of the player, as a string. It is preferred that you use the 'isX' accessors,
254
- * because they properly interpret the range of these values, but this field is exposed if you wish to observe
255
- * or interrogate it.
256
- */
257
- get currentState() {
258
- return this._currentState;
259
- }
260
- get currentTrack() {
261
- return this._currentItem;
262
- }
263
- /**
264
- * If the playlist is currently playling a track.
265
- */
266
- get isPlaying() {
267
- return this._currentState === 'playing';
268
- }
269
- /**
270
- * True if the playlist is currently paused
271
- */
272
- get isPaused() {
273
- return this._currentState === 'paused' || this._currentState === 'stopped';
274
- }
275
- /**
276
- * True if the plugin is currently loading its *current* track.
277
- * On iOS, many tracks are loaded in parallel, so this only reports for the *current item*, e.g.
278
- * the item that will begin playback if you press pause.
279
- * If you need track-specific data, it is better to watch the onStatus stream and watch for RMXSTATUS_LOADING,
280
- * which will be raised independently & simultaneously for every track in the playlist.
281
- * On Android, tracks are only loaded as they begin playback, so this value and RMXSTATUS_LOADING should always
282
- * apply to the same track.
283
- */
284
- get isLoading() {
285
- return this._currentState === 'loading';
286
- }
287
- /**
288
- * True if the *currently playing track* has been loaded and can be played (this includes if it is *currently playing*).
289
- */
290
- get hasLoaded() {
291
- return this._hasLoaded;
292
- }
293
- /**
294
- * True if the *current track* has reported an error. In almost all cases,
295
- * the playlist will automatically skip forward to the next track, in which case you will also receive
296
- * an RMXSTATUS_TRACK_CHANGED event.
297
- */
298
- get hasError() {
299
- return this._hasError;
300
- }
301
- /**
302
- * Creates a new RmxAudioPlayer instance.
303
- */
304
- constructor() {
305
- this.handlers = {};
306
- this.options = { verbose: false, resetStreamOnPause: true };
307
- this._readyResolve = () => {
308
- };
309
- this._readyReject = () => {
310
- };
311
- this._currentState = 'unknown';
312
- this._hasError = false;
313
- this._hasLoaded = false;
314
- this._currentItem = null;
315
- /**
316
- * Player interface
317
- */
318
- /**
319
- * Returns a promise that resolves when the plugin is ready.
320
- */
321
- this.ready = () => {
322
- return this._initPromise;
323
- };
324
- this.initialize = async () => {
325
- Playlist.addListener('status', (data) => {
326
- if (data.action === 'status') {
327
- this.onStatus(data.status.trackId, data.status.msgType, data.status.value);
328
- }
329
- else {
330
- console.warn('Unknown audio player onStatus message:', data);
331
- }
332
- });
333
- try {
334
- await Playlist.initialize();
335
- this._readyResolve();
336
- }
337
- catch (args) {
338
- const message = 'Capacitor RMXAUDIOPLAYER: Error initializing:';
339
- console.warn(message, args);
340
- this._readyReject();
341
- }
342
- };
343
- /**
344
- * Sets the player options. This can be called at any time and is not required before playback can be initiated.
345
- */
346
- this.setOptions = (options) => {
347
- this.options = Object.assign(Object.assign({}, this.options), options);
348
- return Playlist.setOptions(this.options);
349
- };
350
- /**
351
- * Playlist item management
352
- */
353
- /**
354
- * Sets the entire list of tracks to be played by the playlist.
355
- * This will clear all previous items from the playlist.
356
- * If you pass options.retainPosition = true, the current playback position will be
357
- * recorded and used when playback restarts. This can be used, for example, to set the
358
- * playlist to a new set of tracks, but retain the currently-playing item to avoid skipping.
359
- */
360
- this.setPlaylistItems = (items, options) => {
361
- return Playlist.setPlaylistItems({ items: validateTracks(items), options: options || {} });
362
- };
363
- /**
364
- * Add a single track to the end of the playlist
365
- */
366
- this.addItem = (trackItem) => {
367
- const validTrackItem = validateTrack(trackItem);
368
- if (!validTrackItem) {
369
- throw new Error('Provided track is null or not an audio track');
370
- }
371
- return Playlist.addItem({ item: validTrackItem });
372
- };
373
- /**
374
- * Adds the list of tracks to the end of the playlist.
375
- */
376
- this.addAllItems = (items) => {
377
- return Playlist.addAllItems({ items: validateTracks(items) });
378
- };
379
- /**
380
- * Removes a track from the playlist. If this is the currently playing item, the next item will automatically begin playback.
381
- */
382
- this.removeItem = (removeItem) => {
383
- if (!removeItem) {
384
- throw new Error('Track removal spec is empty');
385
- }
386
- if (!removeItem.trackId && removeItem.trackIndex === undefined) {
387
- throw new Error('Track removal spec is invalid');
388
- }
389
- return Playlist.removeItem({
390
- id: removeItem.trackId,
391
- index: removeItem.trackIndex
392
- });
393
- };
394
- /**
395
- * Removes all given tracks from the playlist; these can be specified either by trackId or trackIndex. If the removed items
396
- * include the currently playing item, the next available item will automatically begin playing.
397
- */
398
- this.removeItems = (items) => {
399
- return Playlist.removeItems({
400
- items: (items || []).map((item) => ({
401
- id: item === null || item === void 0 ? void 0 : item.trackId,
402
- index: item === null || item === void 0 ? void 0 : item.trackIndex
403
- }))
404
- });
405
- };
406
- /**
407
- * Clear the entire playlist. This will result in the STOPPED event being raised.
408
- */
409
- this.clearAllItems = () => {
410
- return Playlist.clearAllItems();
411
- };
412
- /**
413
- * Playback management
414
- */
415
- /**
416
- * Begin playback. If no tracks have been added, this has no effect.
417
- */
418
- this.play = () => {
419
- return Playlist.play();
420
- };
421
- /**
422
- * Play the track at the given index. If the track does not exist, this has no effect.
423
- */
424
- this.playTrackByIndex = (index, position) => {
425
- return Playlist.playTrackByIndex({ index, position: position || 0 });
426
- };
427
- /**
428
- * Play the track matching the given trackId. If the track does not exist, this has no effect.
429
- */
430
- this.playTrackById = (id, position) => {
431
- return Playlist.playTrackById({ id, position: position || 0 });
432
- };
433
- /**
434
- * Play the track matching the given trackId. If the track does not exist, this has no effect.
435
- */
436
- this.selectTrackByIndex = (index, position) => {
437
- return Playlist.selectTrackByIndex({ index, position: position || 0 });
438
- };
439
- /**
440
- * Play the track matching the given trackId. If the track does not exist, this has no effect.
441
- */
442
- this.selectTrackById = (id, position) => {
443
- return Playlist.selectTrackById({ id, position: position || 0 });
444
- };
445
- /**
446
- * Pause playback
447
- */
448
- this.pause = () => {
449
- return Playlist.pause();
450
- };
451
- /**
452
- * Skip to the next track. If you are already at the end, and loop is false, this has no effect.
453
- * If you are at the end, and loop is true, playback will begin at the beginning of the playlist.
454
- */
455
- this.skipForward = () => {
456
- return Playlist.skipForward();
457
- };
458
- /**
459
- * Skip to the previous track. If you are already at the beginning, this has no effect.
460
- */
461
- this.skipBack = () => {
462
- return Playlist.skipBack();
463
- };
464
- /**
465
- * Seek to the given position in the currently playing track. If the value exceeds the track length,
466
- * the track will complete and playback of the next track will begin.
467
- */
468
- this.seekTo = (position) => {
469
- return Playlist.seekTo({ position });
470
- };
471
- /**
472
- * Set the playback speed; a float value between [-1, 1] inclusive. If set to 0, this pauses playback.
473
- */
474
- this.setPlaybackRate = (rate) => {
475
- return Playlist.setPlaybackRate({ rate });
476
- };
477
- /**
478
- * Set the playback volume. Float value between [0, 1] inclusive.
479
- * On both Android and iOS, this sets the volume of the media stream, which can be externally
480
- * controlled by setting the overall hardware volume.
481
- */
482
- this.setVolume = (volume) => {
483
- return Playlist.setPlaybackVolume({ volume });
484
- };
485
- /**
486
- * Sets a flag indicating whether the playlist should loop back to the beginning once it reaches the end.
487
- */
488
- this.setLoop = (loop) => {
489
- return Playlist.setLoop({ loop: loop });
490
- };
491
- this.handlers = {};
492
- new Promise((resolve) => {
493
- window.addEventListener('beforeunload', () => resolve(), { once: true });
494
- }).then(() => Playlist.release());
495
- this._initPromise = new Promise((resolve, reject) => {
496
- this._readyResolve = resolve;
497
- this._readyReject = reject;
498
- });
499
- }
500
- /**
501
- * Status event handling
502
- */
503
- /**
504
- * @internal
505
- * Call this function to emit an onStatus event via the on('status') handler.
506
- * Internal use only, to raise events received from the native interface.
507
- */
508
- onStatus(trackId, type, value) {
509
- var _a;
510
- const status = { msgType: type, trackId: trackId, value: value };
511
- if (this.options.verbose) {
512
- console.debug(`RmxAudioPlayer.onStatus: ${RmxAudioStatusMessageDescriptions[type]}(${type}) [${trackId}]: `, value);
513
- }
514
- if (status.msgType === exports.RmxAudioStatusMessage.RMXSTATUS_TRACK_CHANGED) {
515
- this._hasError = false;
516
- this._hasLoaded = false;
517
- this._currentState = 'loading';
518
- this._currentItem = (_a = status.value) === null || _a === void 0 ? void 0 : _a.currentItem;
519
- }
520
- // The plugin's status changes only in response to specific events.
521
- if (itemStatusChangeTypes.indexOf(status.msgType) >= 0) {
522
- // Only change the plugin's *current status* if the event being raised is for the current active track.
523
- if (this._currentItem && this._currentItem.trackId === trackId) {
524
- if (status.value && status.value.status) {
525
- this._currentState = status.value.status;
526
- }
527
- if (status.msgType === exports.RmxAudioStatusMessage.RMXSTATUS_CANPLAY) {
528
- this._hasLoaded = true;
529
- }
530
- if (status.msgType === exports.RmxAudioStatusMessage.RMXSTATUS_ERROR) {
531
- this._hasError = true;
532
- }
533
- }
534
- }
535
- this.emit('status', status);
536
- }
537
- on(eventName, callback) {
538
- if (!Object.prototype.hasOwnProperty.call(this.handlers, eventName)) {
539
- this.handlers[eventName] = [];
540
- }
541
- this.handlers[eventName].push(callback);
542
- }
543
- /**
544
- * Remove an event handler from the plugin
545
- * @param eventName The name of the event whose subscription is to be removed
546
- * @param handle The event handler to destroy. Ensure that this is the SAME INSTANCE as the handler
547
- * that was passed in to create the subscription!
548
- */
549
- off(eventName, handle) {
550
- if (Object.prototype.hasOwnProperty.call(this.handlers, eventName)) {
551
- const handleIndex = this.handlers[eventName].indexOf(handle);
552
- if (handleIndex >= 0) {
553
- this.handlers[eventName].splice(handleIndex, 1);
554
- }
555
- }
556
- }
557
- /**
558
- * @internal
559
- * Raises an event via the corresponding event handler. Internal use only.
560
- * @param args Event args to pass through to the handler.
561
- */
562
- emit(...args) {
563
- const eventName = args.shift();
564
- if (!Object.prototype.hasOwnProperty.call(this.handlers, eventName)) {
565
- return false;
566
- }
567
- const handler = this.handlers[eventName];
568
- for (let i = 0; i < handler.length; i++) {
569
- const callback = this.handlers[eventName][i];
570
- if (typeof callback === 'function') {
571
- callback(...args);
572
- }
573
- }
574
- return true;
575
- }
576
- }
577
-
578
- class PlaylistWeb extends core.WebPlugin {
579
- constructor() {
580
- super(...arguments);
581
- this.playlistItems = [];
582
- this.loop = false;
583
- this.options = {};
584
- this.currentTrack = null;
585
- this.lastState = 'stopped';
586
- this.hlsLoaded = false;
587
- }
588
- addAllItems(options) {
589
- this.playlistItems = this.playlistItems.concat(validateTracks(options.items));
590
- return Promise.resolve();
591
- }
592
- addItem(options) {
593
- const track = validateTrack(options.item);
594
- if (track) {
595
- this.playlistItems.push(track);
596
- this.updateStatus(exports.RmxAudioStatusMessage.RMXSTATUS_ITEM_ADDED, track, track.trackId);
597
- }
598
- return Promise.resolve();
599
- }
600
- async clearAllItems() {
601
- await this.release();
602
- this.playlistItems = [];
603
- this.updateStatus(exports.RmxAudioStatusMessage.RMXSTATUS_PLAYLIST_CLEARED, null, "INVALID");
604
- return Promise.resolve();
605
- }
606
- async getPlaylist() {
607
- return Promise.resolve({ items: this.playlistItems });
608
- }
609
- async initialize() {
610
- this.updateStatus(exports.RmxAudioStatusMessage.RMXSTATUS_INIT, null, "INVALID");
611
- return Promise.resolve();
612
- }
613
- async pause() {
614
- var _a;
615
- (_a = this.audio) === null || _a === void 0 ? void 0 : _a.pause();
616
- }
617
- async play() {
618
- var _a;
619
- await ((_a = this.audio) === null || _a === void 0 ? void 0 : _a.play());
620
- }
621
- async playTrackById(options) {
622
- for (let track of this.playlistItems) {
623
- if (track.trackId === options.id) {
624
- if (track !== this.currentTrack) {
625
- await this.setCurrent(track);
626
- if (this.audio && (options === null || options === void 0 ? void 0 : options.position) && options.position > 0) {
627
- this.audio.currentTime = options.position;
628
- }
629
- }
630
- return this.play();
631
- }
632
- }
633
- return Promise.reject();
634
- }
635
- async playTrackByIndex(options) {
636
- for (let { index, item } of this.playlistItems.map((item, index) => ({ index, item }))) {
637
- if (index === options.index) {
638
- if (item !== this.currentTrack) {
639
- await this.setCurrent(item);
640
- if (this.audio && (options === null || options === void 0 ? void 0 : options.position) && options.position > 0) {
641
- this.audio.currentTime = options.position;
642
- }
643
- }
644
- return this.play();
645
- }
646
- }
647
- return Promise.reject();
648
- }
649
- async release() {
650
- await this.pause();
651
- this.audio = undefined;
652
- return Promise.resolve();
653
- }
654
- async create() {
655
- this.audio = document.createElement('audio');
656
- this.audio.crossOrigin = 'anonymous';
657
- this.audio.preload = 'metadata';
658
- this.audio.controls = true;
659
- this.audio.autoplay = false;
660
- return Promise.resolve();
661
- }
662
- removeItem(options) {
663
- // options.index can be 0; don't use a truthy check.
664
- let removeIndex = -1;
665
- if (options.index !== undefined && options.index !== null) {
666
- removeIndex = options.index;
667
- }
668
- else if (options.id) {
669
- removeIndex = this.playlistItems.findIndex((t) => t.trackId === options.id);
670
- }
671
- if (removeIndex >= 0 && removeIndex < this.playlistItems.length) {
672
- const removedTrack = this.playlistItems.splice(removeIndex, 1)[0];
673
- this.updateStatus(exports.RmxAudioStatusMessage.RMXSTATUS_ITEM_REMOVED, removedTrack, removedTrack === null || removedTrack === void 0 ? void 0 : removedTrack.trackId);
674
- }
675
- return Promise.resolve();
676
- }
677
- removeItems(options) {
678
- options.items.forEach(async (item) => {
679
- await this.removeItem(item);
680
- });
681
- return Promise.resolve();
682
- }
683
- seekTo(options) {
684
- if (this.audio) {
685
- this.audio.currentTime = options.position;
686
- return Promise.resolve();
687
- }
688
- return Promise.reject();
689
- }
690
- selectTrackById(options) {
691
- for (const item of this.playlistItems) {
692
- if (item.trackId === options.id) {
693
- return this.setCurrent(item);
694
- }
695
- }
696
- return Promise.reject();
697
- }
698
- selectTrackByIndex(options) {
699
- let index = 0;
700
- for (const item of this.playlistItems) {
701
- if (index === options.index) {
702
- return this.setCurrent(item);
703
- }
704
- index++;
705
- }
706
- return Promise.reject();
707
- }
708
- setLoop(options) {
709
- this.loop = options.loop;
710
- return Promise.resolve();
711
- }
712
- setOptions(options) {
713
- this.options = options || {};
714
- return Promise.resolve();
715
- }
716
- setPlaybackVolume(options) {
717
- if (this.audio) {
718
- this.audio.volume = options.volume;
719
- return Promise.resolve();
720
- }
721
- return Promise.reject();
722
- }
723
- async setPlaylistItems(options) {
724
- var _a, _b, _c;
725
- this.playlistItems = options.items;
726
- if (this.playlistItems.length > 0) {
727
- let currentItem = this.playlistItems.filter(i => { var _a; return i.trackId === ((_a = options.options) === null || _a === void 0 ? void 0 : _a.playFromId); })[0];
728
- if (!currentItem) {
729
- currentItem = this.playlistItems[0];
730
- }
731
- await this.setCurrent(currentItem, (_b = (_a = options.options) === null || _a === void 0 ? void 0 : _a.playFromPosition) !== null && _b !== void 0 ? _b : 0);
732
- if (!((_c = options.options) === null || _c === void 0 ? void 0 : _c.startPaused)) {
733
- await this.play();
734
- }
735
- }
736
- return Promise.resolve();
737
- }
738
- async skipForward() {
739
- let found = null;
740
- this.playlistItems.forEach((item, index) => {
741
- if (found === null && this.getCurrentTrackId() === item.trackId) {
742
- found = index;
743
- }
744
- });
745
- if (found === this.playlistItems.length - 1) {
746
- found = -1;
747
- }
748
- if (found !== null) {
749
- const targetIndex = found + 1;
750
- this.updateStatus(exports.RmxAudioStatusMessage.RMX_STATUS_SKIP_FORWARD, {
751
- currentIndex: targetIndex,
752
- currentItem: this.playlistItems[targetIndex]
753
- }, this.playlistItems[targetIndex].trackId);
754
- return this.setCurrent(this.playlistItems[targetIndex]);
755
- }
756
- return Promise.reject();
757
- }
758
- async skipBack() {
759
- let found = null;
760
- this.playlistItems.forEach((item, index) => {
761
- if (found === null && this.getCurrentTrackId() === item.trackId) {
762
- found = index;
763
- }
764
- });
765
- if (found !== null) {
766
- const targetIndex = found === 0 ? this.playlistItems.length - 1 : found - 1;
767
- this.updateStatus(exports.RmxAudioStatusMessage.RMX_STATUS_SKIP_BACK, {
768
- currentIndex: targetIndex,
769
- currentItem: this.playlistItems[targetIndex]
770
- }, this.playlistItems[targetIndex].trackId);
771
- return this.setCurrent(this.playlistItems[targetIndex]);
772
- }
773
- return Promise.reject();
774
- }
775
- setPlaybackRate(options) {
776
- if (this.audio) {
777
- this.audio.playbackRate = options.rate;
778
- return Promise.resolve();
779
- }
780
- return Promise.reject();
781
- }
782
- async setMediaSessionRemoteControlMetadata() {
783
- const audioTrack = this.currentTrack;
784
- if (!navigator.mediaSession) {
785
- console.warn('Media Session API not available');
786
- return Promise.reject();
787
- }
788
- navigator.mediaSession.metadata = new MediaMetadata({
789
- title: audioTrack.title,
790
- artist: audioTrack.artist,
791
- album: audioTrack.album,
792
- artwork: [
793
- { src: audioTrack.albumArt, sizes: '96x96', type: 'image/jpeg' },
794
- { src: audioTrack.albumArt, sizes: '128x128', type: 'image/jpeg' },
795
- { src: audioTrack.albumArt, sizes: '192x192', type: 'image/jpeg' },
796
- { src: audioTrack.albumArt, sizes: '256x256', type: 'image/jpeg' },
797
- { src: audioTrack.albumArt, sizes: '384x384', type: 'image/jpeg' },
798
- { src: audioTrack.albumArt, sizes: '512x512', type: 'image/jpeg' },
799
- ]
800
- });
801
- navigator.mediaSession.setActionHandler('play', (details) => { this.mediaSessionControlsHandler(details); });
802
- navigator.mediaSession.setActionHandler('pause', (details) => { this.mediaSessionControlsHandler(details); });
803
- navigator.mediaSession.setActionHandler('nexttrack', (details) => { this.mediaSessionControlsHandler(details); });
804
- navigator.mediaSession.setActionHandler('previoustrack', (details) => { this.mediaSessionControlsHandler(details); });
805
- return Promise.resolve();
806
- }
807
- async mediaSessionControlsHandler(actionDetails) {
808
- switch (actionDetails.action) {
809
- case 'play':
810
- this.play();
811
- break;
812
- case 'pause':
813
- this.pause();
814
- break;
815
- case 'nexttrack':
816
- this.skipForward();
817
- break;
818
- case 'previoustrack':
819
- this.skipBack();
820
- break;
821
- }
822
- return Promise.resolve();
823
- }
824
- // register events
825
- /*
826
- private registerHlsListeners(hls: Hls, position?: number) {
827
- hls.on(Hls.Events.MANIFEST_PARSED, async () => {
828
- this.notifyListeners('status', {
829
- action: "status",
830
- status: {
831
- msgType: RmxAudioStatusMessage.RMXSTATUS_CANPLAY,
832
- trackId: this.getCurrentTrackId(),
833
- value: this.getCurrentTrackStatus('loading'),
834
- }
835
- })
836
- if(position) {
837
- await this.seekTo({position});
838
- }
839
- });
840
- }*/
841
- registerHtmlListeners(position) {
842
- const canPlayListener = async () => {
843
- var _a;
844
- this.updateStatus(exports.RmxAudioStatusMessage.RMXSTATUS_CANPLAY, this.getCurrentTrackStatus('paused'));
845
- if (position) {
846
- await this.seekTo({ position });
847
- }
848
- (_a = this.audio) === null || _a === void 0 ? void 0 : _a.removeEventListener('canplay', canPlayListener);
849
- };
850
- if (this.audio) {
851
- this.audio.addEventListener('loadstart', () => { this.setMediaSessionRemoteControlMetadata(); });
852
- this.audio.addEventListener('canplay', canPlayListener);
853
- this.audio.addEventListener('playing', () => {
854
- this.updateStatus(exports.RmxAudioStatusMessage.RMXSTATUS_PLAYING, this.getCurrentTrackStatus('playing'));
855
- });
856
- this.audio.addEventListener('pause', () => {
857
- this.updateStatus(exports.RmxAudioStatusMessage.RMXSTATUS_PAUSE, this.getCurrentTrackStatus('paused'));
858
- });
859
- this.audio.addEventListener('error', () => {
860
- this.updateStatus(exports.RmxAudioStatusMessage.RMXSTATUS_ERROR, this.getCurrentTrackStatus('error'));
861
- });
862
- this.audio.addEventListener('ended', () => {
863
- this.updateStatus(exports.RmxAudioStatusMessage.RMXSTATUS_COMPLETED, this.getCurrentTrackStatus('stopped'));
864
- const currentTrackIndex = this.playlistItems.findIndex(i => i.trackId === this.getCurrentTrackId());
865
- if (currentTrackIndex === this.playlistItems.length - 1) {
866
- this.updateStatus(exports.RmxAudioStatusMessage.RMXSTATUS_PLAYLIST_COMPLETED, this.getCurrentTrackStatus('stopped'));
867
- }
868
- else {
869
- this.setCurrent(this.playlistItems[currentTrackIndex + 1], undefined, true);
870
- }
871
- });
872
- let lastTrackId, lastPosition;
873
- this.audio.addEventListener('timeupdate', () => {
874
- const status = this.getCurrentTrackStatus(this.lastState);
875
- if (lastTrackId !== this.getCurrentTrackId() || lastPosition !== status.currentPosition) {
876
- this.updateStatus(exports.RmxAudioStatusMessage.RMXSTATUS_PLAYBACK_POSITION, status);
877
- lastTrackId = this.getCurrentTrackId();
878
- lastPosition = status.currentPosition;
879
- }
880
- });
881
- this.audio.addEventListener('durationchange', () => {
882
- this.updateStatus(exports.RmxAudioStatusMessage.RMXSTATUS_DURATION, this.getCurrentTrackStatus(this.lastState));
883
- });
884
- this.audio.addEventListener('seeking', () => {
885
- const status = this.getCurrentTrackStatus(this.lastState);
886
- this.updateStatus(exports.RmxAudioStatusMessage.RMXSTATUS_SEEK, status);
887
- });
888
- }
889
- }
890
- getCurrentTrackId() {
891
- if (this.currentTrack) {
892
- return this.currentTrack.trackId;
893
- }
894
- return 'INVALID';
895
- }
896
- getCurrentIndex() {
897
- if (this.currentTrack) {
898
- for (let i = 0; i < this.playlistItems.length; i++) {
899
- if (this.playlistItems[i].trackId === this.currentTrack.trackId) {
900
- return i;
901
- }
902
- }
903
- }
904
- return -1;
905
- }
906
- getCurrentTrackStatus(currentState) {
907
- var _a, _b, _c;
908
- this.lastState = currentState;
909
- return {
910
- trackId: this.getCurrentTrackId(),
911
- isStream: !!((_a = this.currentTrack) === null || _a === void 0 ? void 0 : _a.isStream),
912
- currentIndex: this.getCurrentIndex(),
913
- status: currentState,
914
- currentPosition: ((_b = this.audio) === null || _b === void 0 ? void 0 : _b.currentTime) || 0,
915
- duration: ((_c = this.audio) === null || _c === void 0 ? void 0 : _c.duration) || 0,
916
- };
917
- }
918
- async setCurrent(item, position, forceAutoplay = false) {
919
- let wasPlaying = false;
920
- if (this.audio) {
921
- wasPlaying = !this.audio.paused;
922
- await this.release();
923
- }
924
- await this.create();
925
- this.currentTrack = item;
926
- if (item.assetUrl.includes('.m3u8')) {
927
- await this.loadHlsJs();
928
- const hls = new Hls({
929
- autoStartLoad: true,
930
- debug: false,
931
- enableWorker: true,
932
- });
933
- hls.attachMedia(this.audio);
934
- hls.on(Hls.Events.MEDIA_ATTACHED, () => {
935
- hls.loadSource(item.assetUrl);
936
- });
937
- //this.registerHlsListeners(hls, position);
938
- }
939
- else {
940
- this.audio.src = item.assetUrl;
941
- }
942
- await this.registerHtmlListeners(position);
943
- this.updateStatus(exports.RmxAudioStatusMessage.RMXSTATUS_TRACK_CHANGED, {
944
- currentItem: item
945
- });
946
- if (wasPlaying || forceAutoplay) {
947
- //this.play();
948
- this.audio.addEventListener('canplay', () => {
949
- this.play();
950
- });
951
- }
952
- }
953
- updateStatus(msgType, value, trackId) {
954
- this.notifyListeners('status', {
955
- action: 'status',
956
- status: {
957
- msgType: msgType,
958
- trackId: trackId ? trackId : this.getCurrentTrackId(),
959
- value: value
960
- }
961
- });
962
- }
963
- loadHlsJs() {
964
- if (window.Hls !== undefined || this.hlsLoaded) {
965
- return Promise.resolve();
966
- }
967
- return new Promise((resolve, reject) => {
968
- console.log("LOADING HLS FROM CDN");
969
- const script = document.createElement('script');
970
- script.type = 'text/javascript';
971
- script.src = 'https://cdn.jsdelivr.net/npm/hls.js@1.1.1';
972
- document.getElementsByTagName('head')[0].appendChild(script);
973
- script.onload = () => {
974
- this.hlsLoaded = true;
975
- resolve(void 0);
976
- };
977
- script.onerror = () => {
978
- reject();
979
- };
980
- });
981
- }
982
- }
983
-
984
- var web = /*#__PURE__*/Object.freeze({
985
- __proto__: null,
986
- PlaylistWeb: PlaylistWeb
987
- });
988
-
989
- exports.Playlist = Playlist;
990
- exports.RmxAudioErrorTypeDescriptions = RmxAudioErrorTypeDescriptions;
991
- exports.RmxAudioPlayer = RmxAudioPlayer;
992
- exports.RmxAudioStatusMessageDescriptions = RmxAudioStatusMessageDescriptions;
993
- //# sourceMappingURL=plugin.cjs.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"plugin.cjs.js","sources":["esm/Constants.js","esm/plugin.js","esm/utils.js","esm/RmxAudioPlayer.js","esm/web.js"],"sourcesContent":["/**\n * Enum describing the possible errors that may come from the plugins\n */\nexport var RmxAudioErrorType;\n(function (RmxAudioErrorType) {\n RmxAudioErrorType[RmxAudioErrorType[\"RMXERR_NONE_ACTIVE\"] = 0] = \"RMXERR_NONE_ACTIVE\";\n RmxAudioErrorType[RmxAudioErrorType[\"RMXERR_ABORTED\"] = 1] = \"RMXERR_ABORTED\";\n RmxAudioErrorType[RmxAudioErrorType[\"RMXERR_NETWORK\"] = 2] = \"RMXERR_NETWORK\";\n RmxAudioErrorType[RmxAudioErrorType[\"RMXERR_DECODE\"] = 3] = \"RMXERR_DECODE\";\n RmxAudioErrorType[RmxAudioErrorType[\"RMXERR_NONE_SUPPORTED\"] = 4] = \"RMXERR_NONE_SUPPORTED\";\n})(RmxAudioErrorType || (RmxAudioErrorType = {}));\n;\n/**\n * String descriptions corresponding to the RmxAudioErrorType values\n */\nexport const RmxAudioErrorTypeDescriptions = [\n 'No Active Sources',\n 'Aborted',\n 'Network',\n 'Failed to Decode',\n 'No Supported Sources',\n];\n/**\n * Enumeration of all status messages raised by the plugin.\n * NONE, REGISTER and INIT are structural and probably not useful to you.\n */\nexport var RmxAudioStatusMessage;\n(function (RmxAudioStatusMessage) {\n /**\n * The starting state of the plugin. You will never see this value;\n * it changes before the callbacks are even registered to report changes to this value.\n */\n RmxAudioStatusMessage[RmxAudioStatusMessage[\"RMXSTATUS_NONE\"] = 0] = \"RMXSTATUS_NONE\";\n /**\n * Raised when the plugin registers the callback handler for onStatus callbacks.\n * You will probably not be able to see this (nor do you need to).\n */\n RmxAudioStatusMessage[RmxAudioStatusMessage[\"RMXSTATUS_REGISTER\"] = 1] = \"RMXSTATUS_REGISTER\";\n /**\n * Reserved for future use\n */\n RmxAudioStatusMessage[RmxAudioStatusMessage[\"RMXSTATUS_INIT\"] = 2] = \"RMXSTATUS_INIT\";\n /**\n * Indicates an error is reported in the 'value' field.\n */\n RmxAudioStatusMessage[RmxAudioStatusMessage[\"RMXSTATUS_ERROR\"] = 5] = \"RMXSTATUS_ERROR\";\n /**\n * The reported track is being loaded by the player\n */\n RmxAudioStatusMessage[RmxAudioStatusMessage[\"RMXSTATUS_LOADING\"] = 10] = \"RMXSTATUS_LOADING\";\n /**\n * The reported track is able to begin playback\n */\n RmxAudioStatusMessage[RmxAudioStatusMessage[\"RMXSTATUS_CANPLAY\"] = 11] = \"RMXSTATUS_CANPLAY\";\n /**\n * The reported track has loaded 100% of the file (either from disc or network)\n */\n RmxAudioStatusMessage[RmxAudioStatusMessage[\"RMXSTATUS_LOADED\"] = 15] = \"RMXSTATUS_LOADED\";\n /**\n * (iOS only): Playback has stalled due to insufficient network\n */\n RmxAudioStatusMessage[RmxAudioStatusMessage[\"RMXSTATUS_STALLED\"] = 20] = \"RMXSTATUS_STALLED\";\n /**\n * Reports an update in the reported track's buffering status\n */\n RmxAudioStatusMessage[RmxAudioStatusMessage[\"RMXSTATUS_BUFFERING\"] = 25] = \"RMXSTATUS_BUFFERING\";\n /**\n * The reported track has started (or resumed) playing\n */\n RmxAudioStatusMessage[RmxAudioStatusMessage[\"RMXSTATUS_PLAYING\"] = 30] = \"RMXSTATUS_PLAYING\";\n /**\n * The reported track has been paused, either by the user or by the system.\n * (iOS only): This value is raised when MP3's are malformed (but still playable).\n * These require the user to explicitly press play again. This can be worked\n * around and is on the TODO list.\n */\n RmxAudioStatusMessage[RmxAudioStatusMessage[\"RMXSTATUS_PAUSE\"] = 35] = \"RMXSTATUS_PAUSE\";\n /**\n * Reports a change in the reported track's playback position.\n */\n RmxAudioStatusMessage[RmxAudioStatusMessage[\"RMXSTATUS_PLAYBACK_POSITION\"] = 40] = \"RMXSTATUS_PLAYBACK_POSITION\";\n /**\n * The reported track has seeked.\n * On Android, only the plugin consumer can generate this (Notification controls on Android do not include a seek bar).\n * On iOS, the Command Center includes a seek bar so this will be reported when the user has seeked via Command Center.\n */\n RmxAudioStatusMessage[RmxAudioStatusMessage[\"RMXSTATUS_SEEK\"] = 45] = \"RMXSTATUS_SEEK\";\n /**\n * The reported track has completed playback.\n */\n RmxAudioStatusMessage[RmxAudioStatusMessage[\"RMXSTATUS_COMPLETED\"] = 50] = \"RMXSTATUS_COMPLETED\";\n /**\n * The reported track's duration has changed. This is raised once, when duration is updated for the first time.\n * For streams, this value is never reported.\n */\n RmxAudioStatusMessage[RmxAudioStatusMessage[\"RMXSTATUS_DURATION\"] = 55] = \"RMXSTATUS_DURATION\";\n /**\n * All playback has stopped, probably because the plugin is shutting down.\n */\n RmxAudioStatusMessage[RmxAudioStatusMessage[\"RMXSTATUS_STOPPED\"] = 60] = \"RMXSTATUS_STOPPED\";\n /**\n * The playlist has skipped forward to the next track.\n * On both Android and iOS, this will be raised if the notification controls/Command Center were used to skip.\n * It is unlikely you need to consume this event: RMXSTATUS_TRACK_CHANGED is also reported when this occurs,\n * so you can generalize your track change handling in one place.\n */\n RmxAudioStatusMessage[RmxAudioStatusMessage[\"RMX_STATUS_SKIP_FORWARD\"] = 90] = \"RMX_STATUS_SKIP_FORWARD\";\n /**\n * The playlist has skipped back to the previous track.\n * On both Android and iOS, this will be raised if the notification controls/Command Center were used to skip.\n * It is unlikely you need to consume this event: RMXSTATUS_TRACK_CHANGED is also reported when this occurs,\n * so you can generalize your track change handling in one place.\n */\n RmxAudioStatusMessage[RmxAudioStatusMessage[\"RMX_STATUS_SKIP_BACK\"] = 95] = \"RMX_STATUS_SKIP_BACK\";\n /**\n * Reported when the current track has changed in the native player. This event contains full data about\n * the new track, including the index and the actual track itself. The type of the 'value' field in this case\n * is OnStatusTrackChangedData.\n */\n RmxAudioStatusMessage[RmxAudioStatusMessage[\"RMXSTATUS_TRACK_CHANGED\"] = 100] = \"RMXSTATUS_TRACK_CHANGED\";\n /**\n * The entire playlist has completed playback.\n * After this event has been raised, the current item is set to null and the current index to -1.\n */\n RmxAudioStatusMessage[RmxAudioStatusMessage[\"RMXSTATUS_PLAYLIST_COMPLETED\"] = 105] = \"RMXSTATUS_PLAYLIST_COMPLETED\";\n /**\n * An item has been added to the playlist. For the setPlaylistItems and addAllItems methods, this status is\n * raised once for every track in the collection.\n */\n RmxAudioStatusMessage[RmxAudioStatusMessage[\"RMXSTATUS_ITEM_ADDED\"] = 110] = \"RMXSTATUS_ITEM_ADDED\";\n /**\n * An item has been removed from the playlist. For the removeItems and clearAllItems methods, this status is\n * raised once for every track that was removed.\n */\n RmxAudioStatusMessage[RmxAudioStatusMessage[\"RMXSTATUS_ITEM_REMOVED\"] = 115] = \"RMXSTATUS_ITEM_REMOVED\";\n /**\n * All items have been removed from the playlist\n */\n RmxAudioStatusMessage[RmxAudioStatusMessage[\"RMXSTATUS_PLAYLIST_CLEARED\"] = 120] = \"RMXSTATUS_PLAYLIST_CLEARED\";\n /**\n * Just for testing.. you don't need this and in fact can never receive it, the plugin is destroyed before it can be raised.\n */\n RmxAudioStatusMessage[RmxAudioStatusMessage[\"RMXSTATUS_VIEWDISAPPEAR\"] = 200] = \"RMXSTATUS_VIEWDISAPPEAR\";\n})(RmxAudioStatusMessage || (RmxAudioStatusMessage = {}));\n;\n/**\n * String descriptions corresponding to the RmxAudioStatusMessage values\n */\nexport const RmxAudioStatusMessageDescriptions = {\n 0: 'No Status',\n 1: 'Plugin Registered',\n 2: 'Plugin Initialized',\n 5: 'Error',\n 10: 'Loading',\n 11: 'CanPlay',\n 15: 'Loaded',\n 20: 'Stalled',\n 25: 'Buffering',\n 30: 'Playing',\n 35: 'Paused',\n 40: 'Playback Position Changed',\n 45: 'Seeked',\n 50: 'Playback Completed',\n 55: 'Duration Changed',\n 60: 'Stopped',\n 90: 'Skip Forward',\n 95: 'Skip Backward',\n 100: 'Track Changed',\n 105: 'Playlist Completed',\n 110: 'Track Added',\n 115: 'Track Removed',\n 120: 'Playlist Cleared',\n 200: 'DEBUG_View_Disappeared',\n};\n//# sourceMappingURL=Constants.js.map","import { registerPlugin } from '@capacitor/core';\n// todo: find out why we get imported twice\nlet playListWebInstance;\nconst Playlist = registerPlugin('Playlist', {\n web: () => import('./web').then(m => {\n if (!playListWebInstance) {\n playListWebInstance = new m.PlaylistWeb();\n }\n return playListWebInstance;\n }),\n});\nexport { Playlist };\n//# sourceMappingURL=plugin.js.map","/**\n * Validates the list of AudioTrack items to ensure they are valid.\n * Used internally but you can call this if you need to :)\n *\n * @param items The AudioTrack items to validate\n */\nexport const validateTracks = (items) => {\n if (!items || !Array.isArray(items)) {\n return [];\n }\n return items.map(validateTrack).filter(x => !!x); // may produce an empty array!\n};\n/**\n * Validate a single track and ensure it is valid for playback.\n * Used internally but you can call this if you need to :)\n *\n * @param track The AudioTrack to validate\n */\nexport const validateTrack = (track) => {\n if (!track) {\n return null;\n }\n // For now we will rely on TS to do the heavy lifting, but we can add a validation here\n // that all the required fields are valid. For now we just take care of the unique ID.\n track.trackId = track.trackId || generateUUID();\n return track;\n};\n/**\n * Generate a v4 UUID for use as a unique trackId. Used internally, but you can use this to generate track ID's if you want.\n */\nconst generateUUID = () => {\n var d = new Date().getTime();\n if (typeof performance !== 'undefined' && typeof performance.now === 'function') {\n d += performance.now(); //use high-precision timer if available\n }\n // There are better ways to do this in ES6, we are intentionally avoiding the import\n // of an ES6 polyfill here.\n const template = 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx';\n return [].slice.call(template).map(function (c) {\n if (c === '-' || c === '4') {\n return c;\n }\n var r = (d + Math.random() * 16) % 16 | 0;\n d = Math.floor(d / 16);\n return (c === 'x' ? r : (r & 0x3 | 0x8)).toString(16);\n }).join('');\n};\n//# sourceMappingURL=utils.js.map","import { RmxAudioStatusMessage, RmxAudioStatusMessageDescriptions } from './Constants';\nimport { Playlist } from './plugin';\nimport { validateTrack, validateTracks } from './utils';\n/*!\n * Module dependencies.\n */\nconst itemStatusChangeTypes = [\n RmxAudioStatusMessage.RMXSTATUS_PLAYBACK_POSITION,\n RmxAudioStatusMessage.RMXSTATUS_DURATION,\n RmxAudioStatusMessage.RMXSTATUS_BUFFERING,\n RmxAudioStatusMessage.RMXSTATUS_CANPLAY,\n RmxAudioStatusMessage.RMXSTATUS_LOADING,\n RmxAudioStatusMessage.RMXSTATUS_LOADED,\n RmxAudioStatusMessage.RMXSTATUS_PAUSE,\n RmxAudioStatusMessage.RMXSTATUS_COMPLETED,\n RmxAudioStatusMessage.RMXSTATUS_ERROR,\n];\nexport class RmxAudioPlayer {\n /**\n * The current summarized state of the player, as a string. It is preferred that you use the 'isX' accessors,\n * because they properly interpret the range of these values, but this field is exposed if you wish to observe\n * or interrogate it.\n */\n get currentState() {\n return this._currentState;\n }\n get currentTrack() {\n return this._currentItem;\n }\n /**\n * If the playlist is currently playling a track.\n */\n get isPlaying() {\n return this._currentState === 'playing';\n }\n /**\n * True if the playlist is currently paused\n */\n get isPaused() {\n return this._currentState === 'paused' || this._currentState === 'stopped';\n }\n /**\n * True if the plugin is currently loading its *current* track.\n * On iOS, many tracks are loaded in parallel, so this only reports for the *current item*, e.g.\n * the item that will begin playback if you press pause.\n * If you need track-specific data, it is better to watch the onStatus stream and watch for RMXSTATUS_LOADING,\n * which will be raised independently & simultaneously for every track in the playlist.\n * On Android, tracks are only loaded as they begin playback, so this value and RMXSTATUS_LOADING should always\n * apply to the same track.\n */\n get isLoading() {\n return this._currentState === 'loading';\n }\n /**\n * True if the *currently playing track* has been loaded and can be played (this includes if it is *currently playing*).\n */\n get hasLoaded() {\n return this._hasLoaded;\n }\n /**\n * True if the *current track* has reported an error. In almost all cases,\n * the playlist will automatically skip forward to the next track, in which case you will also receive\n * an RMXSTATUS_TRACK_CHANGED event.\n */\n get hasError() {\n return this._hasError;\n }\n /**\n * Creates a new RmxAudioPlayer instance.\n */\n constructor() {\n this.handlers = {};\n this.options = { verbose: false, resetStreamOnPause: true };\n this._readyResolve = () => {\n };\n this._readyReject = () => {\n };\n this._currentState = 'unknown';\n this._hasError = false;\n this._hasLoaded = false;\n this._currentItem = null;\n /**\n * Player interface\n */\n /**\n * Returns a promise that resolves when the plugin is ready.\n */\n this.ready = () => {\n return this._initPromise;\n };\n this.initialize = async () => {\n Playlist.addListener('status', (data) => {\n if (data.action === 'status') {\n this.onStatus(data.status.trackId, data.status.msgType, data.status.value);\n }\n else {\n console.warn('Unknown audio player onStatus message:', data);\n }\n });\n try {\n await Playlist.initialize();\n this._readyResolve();\n }\n catch (args) {\n const message = 'Capacitor RMXAUDIOPLAYER: Error initializing:';\n console.warn(message, args);\n this._readyReject();\n }\n };\n /**\n * Sets the player options. This can be called at any time and is not required before playback can be initiated.\n */\n this.setOptions = (options) => {\n this.options = Object.assign(Object.assign({}, this.options), options);\n return Playlist.setOptions(this.options);\n };\n /**\n * Playlist item management\n */\n /**\n * Sets the entire list of tracks to be played by the playlist.\n * This will clear all previous items from the playlist.\n * If you pass options.retainPosition = true, the current playback position will be\n * recorded and used when playback restarts. This can be used, for example, to set the\n * playlist to a new set of tracks, but retain the currently-playing item to avoid skipping.\n */\n this.setPlaylistItems = (items, options) => {\n return Playlist.setPlaylistItems({ items: validateTracks(items), options: options || {} });\n };\n /**\n * Add a single track to the end of the playlist\n */\n this.addItem = (trackItem) => {\n const validTrackItem = validateTrack(trackItem);\n if (!validTrackItem) {\n throw new Error('Provided track is null or not an audio track');\n }\n return Playlist.addItem({ item: validTrackItem });\n };\n /**\n * Adds the list of tracks to the end of the playlist.\n */\n this.addAllItems = (items) => {\n return Playlist.addAllItems({ items: validateTracks(items) });\n };\n /**\n * Removes a track from the playlist. If this is the currently playing item, the next item will automatically begin playback.\n */\n this.removeItem = (removeItem) => {\n if (!removeItem) {\n throw new Error('Track removal spec is empty');\n }\n if (!removeItem.trackId && removeItem.trackIndex === undefined) {\n throw new Error('Track removal spec is invalid');\n }\n return Playlist.removeItem({\n id: removeItem.trackId,\n index: removeItem.trackIndex\n });\n };\n /**\n * Removes all given tracks from the playlist; these can be specified either by trackId or trackIndex. If the removed items\n * include the currently playing item, the next available item will automatically begin playing.\n */\n this.removeItems = (items) => {\n return Playlist.removeItems({\n items: (items || []).map((item) => ({\n id: item === null || item === void 0 ? void 0 : item.trackId,\n index: item === null || item === void 0 ? void 0 : item.trackIndex\n }))\n });\n };\n /**\n * Clear the entire playlist. This will result in the STOPPED event being raised.\n */\n this.clearAllItems = () => {\n return Playlist.clearAllItems();\n };\n /**\n * Playback management\n */\n /**\n * Begin playback. If no tracks have been added, this has no effect.\n */\n this.play = () => {\n return Playlist.play();\n };\n /**\n * Play the track at the given index. If the track does not exist, this has no effect.\n */\n this.playTrackByIndex = (index, position) => {\n return Playlist.playTrackByIndex({ index, position: position || 0 });\n };\n /**\n * Play the track matching the given trackId. If the track does not exist, this has no effect.\n */\n this.playTrackById = (id, position) => {\n return Playlist.playTrackById({ id, position: position || 0 });\n };\n /**\n * Play the track matching the given trackId. If the track does not exist, this has no effect.\n */\n this.selectTrackByIndex = (index, position) => {\n return Playlist.selectTrackByIndex({ index, position: position || 0 });\n };\n /**\n * Play the track matching the given trackId. If the track does not exist, this has no effect.\n */\n this.selectTrackById = (id, position) => {\n return Playlist.selectTrackById({ id, position: position || 0 });\n };\n /**\n * Pause playback\n */\n this.pause = () => {\n return Playlist.pause();\n };\n /**\n * Skip to the next track. If you are already at the end, and loop is false, this has no effect.\n * If you are at the end, and loop is true, playback will begin at the beginning of the playlist.\n */\n this.skipForward = () => {\n return Playlist.skipForward();\n };\n /**\n * Skip to the previous track. If you are already at the beginning, this has no effect.\n */\n this.skipBack = () => {\n return Playlist.skipBack();\n };\n /**\n * Seek to the given position in the currently playing track. If the value exceeds the track length,\n * the track will complete and playback of the next track will begin.\n */\n this.seekTo = (position) => {\n return Playlist.seekTo({ position });\n };\n /**\n * Set the playback speed; a float value between [-1, 1] inclusive. If set to 0, this pauses playback.\n */\n this.setPlaybackRate = (rate) => {\n return Playlist.setPlaybackRate({ rate });\n };\n /**\n * Set the playback volume. Float value between [0, 1] inclusive.\n * On both Android and iOS, this sets the volume of the media stream, which can be externally\n * controlled by setting the overall hardware volume.\n */\n this.setVolume = (volume) => {\n return Playlist.setPlaybackVolume({ volume });\n };\n /**\n * Sets a flag indicating whether the playlist should loop back to the beginning once it reaches the end.\n */\n this.setLoop = (loop) => {\n return Playlist.setLoop({ loop: loop });\n };\n this.handlers = {};\n new Promise((resolve) => {\n window.addEventListener('beforeunload', () => resolve(), { once: true });\n }).then(() => Playlist.release());\n this._initPromise = new Promise((resolve, reject) => {\n this._readyResolve = resolve;\n this._readyReject = reject;\n });\n }\n /**\n * Status event handling\n */\n /**\n * @internal\n * Call this function to emit an onStatus event via the on('status') handler.\n * Internal use only, to raise events received from the native interface.\n */\n onStatus(trackId, type, value) {\n var _a;\n const status = { msgType: type, trackId: trackId, value: value };\n if (this.options.verbose) {\n console.debug(`RmxAudioPlayer.onStatus: ${RmxAudioStatusMessageDescriptions[type]}(${type}) [${trackId}]: `, value);\n }\n if (status.msgType === RmxAudioStatusMessage.RMXSTATUS_TRACK_CHANGED) {\n this._hasError = false;\n this._hasLoaded = false;\n this._currentState = 'loading';\n this._currentItem = (_a = status.value) === null || _a === void 0 ? void 0 : _a.currentItem;\n }\n // The plugin's status changes only in response to specific events.\n if (itemStatusChangeTypes.indexOf(status.msgType) >= 0) {\n // Only change the plugin's *current status* if the event being raised is for the current active track.\n if (this._currentItem && this._currentItem.trackId === trackId) {\n if (status.value && status.value.status) {\n this._currentState = status.value.status;\n }\n if (status.msgType === RmxAudioStatusMessage.RMXSTATUS_CANPLAY) {\n this._hasLoaded = true;\n }\n if (status.msgType === RmxAudioStatusMessage.RMXSTATUS_ERROR) {\n this._hasError = true;\n }\n }\n }\n this.emit('status', status);\n }\n on(eventName, callback) {\n if (!Object.prototype.hasOwnProperty.call(this.handlers, eventName)) {\n this.handlers[eventName] = [];\n }\n this.handlers[eventName].push(callback);\n }\n /**\n * Remove an event handler from the plugin\n * @param eventName The name of the event whose subscription is to be removed\n * @param handle The event handler to destroy. Ensure that this is the SAME INSTANCE as the handler\n * that was passed in to create the subscription!\n */\n off(eventName, handle) {\n if (Object.prototype.hasOwnProperty.call(this.handlers, eventName)) {\n const handleIndex = this.handlers[eventName].indexOf(handle);\n if (handleIndex >= 0) {\n this.handlers[eventName].splice(handleIndex, 1);\n }\n }\n }\n /**\n * @internal\n * Raises an event via the corresponding event handler. Internal use only.\n * @param args Event args to pass through to the handler.\n */\n emit(...args) {\n const eventName = args.shift();\n if (!Object.prototype.hasOwnProperty.call(this.handlers, eventName)) {\n return false;\n }\n const handler = this.handlers[eventName];\n for (let i = 0; i < handler.length; i++) {\n const callback = this.handlers[eventName][i];\n if (typeof callback === 'function') {\n callback(...args);\n }\n }\n return true;\n }\n}\n//# sourceMappingURL=RmxAudioPlayer.js.map","import { WebPlugin } from '@capacitor/core';\nimport { RmxAudioStatusMessage } from './Constants';\nimport { validateTrack, validateTracks } from './utils';\nexport class PlaylistWeb extends WebPlugin {\n constructor() {\n super(...arguments);\n this.playlistItems = [];\n this.loop = false;\n this.options = {};\n this.currentTrack = null;\n this.lastState = 'stopped';\n this.hlsLoaded = false;\n }\n addAllItems(options) {\n this.playlistItems = this.playlistItems.concat(validateTracks(options.items));\n return Promise.resolve();\n }\n addItem(options) {\n const track = validateTrack(options.item);\n if (track) {\n this.playlistItems.push(track);\n this.updateStatus(RmxAudioStatusMessage.RMXSTATUS_ITEM_ADDED, track, track.trackId);\n }\n return Promise.resolve();\n }\n async clearAllItems() {\n await this.release();\n this.playlistItems = [];\n this.updateStatus(RmxAudioStatusMessage.RMXSTATUS_PLAYLIST_CLEARED, null, \"INVALID\");\n return Promise.resolve();\n }\n async getPlaylist() {\n return Promise.resolve({ items: this.playlistItems });\n }\n async initialize() {\n this.updateStatus(RmxAudioStatusMessage.RMXSTATUS_INIT, null, \"INVALID\");\n return Promise.resolve();\n }\n async pause() {\n var _a;\n (_a = this.audio) === null || _a === void 0 ? void 0 : _a.pause();\n }\n async play() {\n var _a;\n await ((_a = this.audio) === null || _a === void 0 ? void 0 : _a.play());\n }\n async playTrackById(options) {\n for (let track of this.playlistItems) {\n if (track.trackId === options.id) {\n if (track !== this.currentTrack) {\n await this.setCurrent(track);\n if (this.audio && (options === null || options === void 0 ? void 0 : options.position) && options.position > 0) {\n this.audio.currentTime = options.position;\n }\n }\n return this.play();\n }\n }\n return Promise.reject();\n }\n async playTrackByIndex(options) {\n for (let { index, item } of this.playlistItems.map((item, index) => ({ index, item }))) {\n if (index === options.index) {\n if (item !== this.currentTrack) {\n await this.setCurrent(item);\n if (this.audio && (options === null || options === void 0 ? void 0 : options.position) && options.position > 0) {\n this.audio.currentTime = options.position;\n }\n }\n return this.play();\n }\n }\n return Promise.reject();\n }\n async release() {\n await this.pause();\n this.audio = undefined;\n return Promise.resolve();\n }\n async create() {\n this.audio = document.createElement('audio');\n this.audio.crossOrigin = 'anonymous';\n this.audio.preload = 'metadata';\n this.audio.controls = true;\n this.audio.autoplay = false;\n return Promise.resolve();\n }\n removeItem(options) {\n // options.index can be 0; don't use a truthy check.\n let removeIndex = -1;\n if (options.index !== undefined && options.index !== null) {\n removeIndex = options.index;\n }\n else if (options.id) {\n removeIndex = this.playlistItems.findIndex((t) => t.trackId === options.id);\n }\n if (removeIndex >= 0 && removeIndex < this.playlistItems.length) {\n const removedTrack = this.playlistItems.splice(removeIndex, 1)[0];\n this.updateStatus(RmxAudioStatusMessage.RMXSTATUS_ITEM_REMOVED, removedTrack, removedTrack === null || removedTrack === void 0 ? void 0 : removedTrack.trackId);\n }\n return Promise.resolve();\n }\n removeItems(options) {\n options.items.forEach(async (item) => {\n await this.removeItem(item);\n });\n return Promise.resolve();\n }\n seekTo(options) {\n if (this.audio) {\n this.audio.currentTime = options.position;\n return Promise.resolve();\n }\n return Promise.reject();\n }\n selectTrackById(options) {\n for (const item of this.playlistItems) {\n if (item.trackId === options.id) {\n return this.setCurrent(item);\n }\n }\n return Promise.reject();\n }\n selectTrackByIndex(options) {\n let index = 0;\n for (const item of this.playlistItems) {\n if (index === options.index) {\n return this.setCurrent(item);\n }\n index++;\n }\n return Promise.reject();\n }\n setLoop(options) {\n this.loop = options.loop;\n return Promise.resolve();\n }\n setOptions(options) {\n this.options = options || {};\n return Promise.resolve();\n }\n setPlaybackVolume(options) {\n if (this.audio) {\n this.audio.volume = options.volume;\n return Promise.resolve();\n }\n return Promise.reject();\n }\n async setPlaylistItems(options) {\n var _a, _b, _c;\n this.playlistItems = options.items;\n if (this.playlistItems.length > 0) {\n let currentItem = this.playlistItems.filter(i => { var _a; return i.trackId === ((_a = options.options) === null || _a === void 0 ? void 0 : _a.playFromId); })[0];\n if (!currentItem) {\n currentItem = this.playlistItems[0];\n }\n await this.setCurrent(currentItem, (_b = (_a = options.options) === null || _a === void 0 ? void 0 : _a.playFromPosition) !== null && _b !== void 0 ? _b : 0);\n if (!((_c = options.options) === null || _c === void 0 ? void 0 : _c.startPaused)) {\n await this.play();\n }\n }\n return Promise.resolve();\n }\n async skipForward() {\n let found = null;\n this.playlistItems.forEach((item, index) => {\n if (found === null && this.getCurrentTrackId() === item.trackId) {\n found = index;\n }\n });\n if (found === this.playlistItems.length - 1) {\n found = -1;\n }\n if (found !== null) {\n const targetIndex = found + 1;\n this.updateStatus(RmxAudioStatusMessage.RMX_STATUS_SKIP_FORWARD, {\n currentIndex: targetIndex,\n currentItem: this.playlistItems[targetIndex]\n }, this.playlistItems[targetIndex].trackId);\n return this.setCurrent(this.playlistItems[targetIndex]);\n }\n return Promise.reject();\n }\n async skipBack() {\n let found = null;\n this.playlistItems.forEach((item, index) => {\n if (found === null && this.getCurrentTrackId() === item.trackId) {\n found = index;\n }\n });\n if (found !== null) {\n const targetIndex = found === 0 ? this.playlistItems.length - 1 : found - 1;\n this.updateStatus(RmxAudioStatusMessage.RMX_STATUS_SKIP_BACK, {\n currentIndex: targetIndex,\n currentItem: this.playlistItems[targetIndex]\n }, this.playlistItems[targetIndex].trackId);\n return this.setCurrent(this.playlistItems[targetIndex]);\n }\n return Promise.reject();\n }\n setPlaybackRate(options) {\n if (this.audio) {\n this.audio.playbackRate = options.rate;\n return Promise.resolve();\n }\n return Promise.reject();\n }\n async setMediaSessionRemoteControlMetadata() {\n const audioTrack = this.currentTrack;\n if (!navigator.mediaSession) {\n console.warn('Media Session API not available');\n return Promise.reject();\n }\n navigator.mediaSession.metadata = new MediaMetadata({\n title: audioTrack.title,\n artist: audioTrack.artist,\n album: audioTrack.album,\n artwork: [\n { src: audioTrack.albumArt, sizes: '96x96', type: 'image/jpeg' },\n { src: audioTrack.albumArt, sizes: '128x128', type: 'image/jpeg' },\n { src: audioTrack.albumArt, sizes: '192x192', type: 'image/jpeg' },\n { src: audioTrack.albumArt, sizes: '256x256', type: 'image/jpeg' },\n { src: audioTrack.albumArt, sizes: '384x384', type: 'image/jpeg' },\n { src: audioTrack.albumArt, sizes: '512x512', type: 'image/jpeg' },\n ]\n });\n navigator.mediaSession.setActionHandler('play', (details) => { this.mediaSessionControlsHandler(details); });\n navigator.mediaSession.setActionHandler('pause', (details) => { this.mediaSessionControlsHandler(details); });\n navigator.mediaSession.setActionHandler('nexttrack', (details) => { this.mediaSessionControlsHandler(details); });\n navigator.mediaSession.setActionHandler('previoustrack', (details) => { this.mediaSessionControlsHandler(details); });\n return Promise.resolve();\n }\n async mediaSessionControlsHandler(actionDetails) {\n switch (actionDetails.action) {\n case 'play':\n this.play();\n break;\n case 'pause':\n this.pause();\n break;\n case 'nexttrack':\n this.skipForward();\n break;\n case 'previoustrack':\n this.skipBack();\n break;\n }\n return Promise.resolve();\n }\n // register events\n /*\n private registerHlsListeners(hls: Hls, position?: number) {\n hls.on(Hls.Events.MANIFEST_PARSED, async () => {\n this.notifyListeners('status', {\n action: \"status\",\n status: {\n msgType: RmxAudioStatusMessage.RMXSTATUS_CANPLAY,\n trackId: this.getCurrentTrackId(),\n value: this.getCurrentTrackStatus('loading'),\n }\n })\n if(position) {\n await this.seekTo({position});\n }\n });\n }*/\n registerHtmlListeners(position) {\n const canPlayListener = async () => {\n var _a;\n this.updateStatus(RmxAudioStatusMessage.RMXSTATUS_CANPLAY, this.getCurrentTrackStatus('paused'));\n if (position) {\n await this.seekTo({ position });\n }\n (_a = this.audio) === null || _a === void 0 ? void 0 : _a.removeEventListener('canplay', canPlayListener);\n };\n if (this.audio) {\n this.audio.addEventListener('loadstart', () => { this.setMediaSessionRemoteControlMetadata(); });\n this.audio.addEventListener('canplay', canPlayListener);\n this.audio.addEventListener('playing', () => {\n this.updateStatus(RmxAudioStatusMessage.RMXSTATUS_PLAYING, this.getCurrentTrackStatus('playing'));\n });\n this.audio.addEventListener('pause', () => {\n this.updateStatus(RmxAudioStatusMessage.RMXSTATUS_PAUSE, this.getCurrentTrackStatus('paused'));\n });\n this.audio.addEventListener('error', () => {\n this.updateStatus(RmxAudioStatusMessage.RMXSTATUS_ERROR, this.getCurrentTrackStatus('error'));\n });\n this.audio.addEventListener('ended', () => {\n this.updateStatus(RmxAudioStatusMessage.RMXSTATUS_COMPLETED, this.getCurrentTrackStatus('stopped'));\n const currentTrackIndex = this.playlistItems.findIndex(i => i.trackId === this.getCurrentTrackId());\n if (currentTrackIndex === this.playlistItems.length - 1) {\n this.updateStatus(RmxAudioStatusMessage.RMXSTATUS_PLAYLIST_COMPLETED, this.getCurrentTrackStatus('stopped'));\n }\n else {\n this.setCurrent(this.playlistItems[currentTrackIndex + 1], undefined, true);\n }\n });\n let lastTrackId, lastPosition;\n this.audio.addEventListener('timeupdate', () => {\n const status = this.getCurrentTrackStatus(this.lastState);\n if (lastTrackId !== this.getCurrentTrackId() || lastPosition !== status.currentPosition) {\n this.updateStatus(RmxAudioStatusMessage.RMXSTATUS_PLAYBACK_POSITION, status);\n lastTrackId = this.getCurrentTrackId();\n lastPosition = status.currentPosition;\n }\n });\n this.audio.addEventListener('durationchange', () => {\n this.updateStatus(RmxAudioStatusMessage.RMXSTATUS_DURATION, this.getCurrentTrackStatus(this.lastState));\n });\n this.audio.addEventListener('seeking', () => {\n const status = this.getCurrentTrackStatus(this.lastState);\n this.updateStatus(RmxAudioStatusMessage.RMXSTATUS_SEEK, status);\n });\n }\n }\n getCurrentTrackId() {\n if (this.currentTrack) {\n return this.currentTrack.trackId;\n }\n return 'INVALID';\n }\n getCurrentIndex() {\n if (this.currentTrack) {\n for (let i = 0; i < this.playlistItems.length; i++) {\n if (this.playlistItems[i].trackId === this.currentTrack.trackId) {\n return i;\n }\n }\n }\n return -1;\n }\n getCurrentTrackStatus(currentState) {\n var _a, _b, _c;\n this.lastState = currentState;\n return {\n trackId: this.getCurrentTrackId(),\n isStream: !!((_a = this.currentTrack) === null || _a === void 0 ? void 0 : _a.isStream),\n currentIndex: this.getCurrentIndex(),\n status: currentState,\n currentPosition: ((_b = this.audio) === null || _b === void 0 ? void 0 : _b.currentTime) || 0,\n duration: ((_c = this.audio) === null || _c === void 0 ? void 0 : _c.duration) || 0,\n };\n }\n async setCurrent(item, position, forceAutoplay = false) {\n let wasPlaying = false;\n if (this.audio) {\n wasPlaying = !this.audio.paused;\n await this.release();\n }\n await this.create();\n this.currentTrack = item;\n if (item.assetUrl.includes('.m3u8')) {\n await this.loadHlsJs();\n const hls = new Hls({\n autoStartLoad: true,\n debug: false,\n enableWorker: true,\n });\n hls.attachMedia(this.audio);\n hls.on(Hls.Events.MEDIA_ATTACHED, () => {\n hls.loadSource(item.assetUrl);\n });\n //this.registerHlsListeners(hls, position);\n }\n else {\n this.audio.src = item.assetUrl;\n }\n await this.registerHtmlListeners(position);\n this.updateStatus(RmxAudioStatusMessage.RMXSTATUS_TRACK_CHANGED, {\n currentItem: item\n });\n if (wasPlaying || forceAutoplay) {\n //this.play();\n this.audio.addEventListener('canplay', () => {\n this.play();\n });\n }\n }\n updateStatus(msgType, value, trackId) {\n this.notifyListeners('status', {\n action: 'status',\n status: {\n msgType: msgType,\n trackId: trackId ? trackId : this.getCurrentTrackId(),\n value: value\n }\n });\n }\n loadHlsJs() {\n if (window.Hls !== undefined || this.hlsLoaded) {\n return Promise.resolve();\n }\n return new Promise((resolve, reject) => {\n console.log(\"LOADING HLS FROM CDN\");\n const script = document.createElement('script');\n script.type = 'text/javascript';\n script.src = 'https://cdn.jsdelivr.net/npm/hls.js@1.1.1';\n document.getElementsByTagName('head')[0].appendChild(script);\n script.onload = () => {\n this.hlsLoaded = true;\n resolve(void 0);\n };\n script.onerror = () => {\n reject();\n };\n });\n }\n}\n//# sourceMappingURL=web.js.map"],"names":["RmxAudioErrorType","RmxAudioStatusMessage","registerPlugin","WebPlugin"],"mappings":";;;;AAAA;AACA;AACA;AACWA;AACX,CAAC,UAAU,iBAAiB,EAAE;AAC9B,IAAI,iBAAiB,CAAC,iBAAiB,CAAC,oBAAoB,CAAC,GAAG,CAAC,CAAC,GAAG,oBAAoB;AACzF,IAAI,iBAAiB,CAAC,iBAAiB,CAAC,gBAAgB,CAAC,GAAG,CAAC,CAAC,GAAG,gBAAgB;AACjF,IAAI,iBAAiB,CAAC,iBAAiB,CAAC,gBAAgB,CAAC,GAAG,CAAC,CAAC,GAAG,gBAAgB;AACjF,IAAI,iBAAiB,CAAC,iBAAiB,CAAC,eAAe,CAAC,GAAG,CAAC,CAAC,GAAG,eAAe;AAC/E,IAAI,iBAAiB,CAAC,iBAAiB,CAAC,uBAAuB,CAAC,GAAG,CAAC,CAAC,GAAG,uBAAuB;AAC/F,CAAC,EAAEA,yBAAiB,KAAKA,yBAAiB,GAAG,EAAE,CAAC,CAAC;AAEjD;AACA;AACA;AACY,MAAC,6BAA6B,GAAG;AAC7C,IAAI,mBAAmB;AACvB,IAAI,SAAS;AACb,IAAI,SAAS;AACb,IAAI,kBAAkB;AACtB,IAAI,sBAAsB;AAC1B;AACA;AACA;AACA;AACA;AACWC;AACX,CAAC,UAAU,qBAAqB,EAAE;AAClC;AACA;AACA;AACA;AACA,IAAI,qBAAqB,CAAC,qBAAqB,CAAC,gBAAgB,CAAC,GAAG,CAAC,CAAC,GAAG,gBAAgB;AACzF;AACA;AACA;AACA;AACA,IAAI,qBAAqB,CAAC,qBAAqB,CAAC,oBAAoB,CAAC,GAAG,CAAC,CAAC,GAAG,oBAAoB;AACjG;AACA;AACA;AACA,IAAI,qBAAqB,CAAC,qBAAqB,CAAC,gBAAgB,CAAC,GAAG,CAAC,CAAC,GAAG,gBAAgB;AACzF;AACA;AACA;A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