@mustafaj/capacitor-plugin-playlist 0.9.0

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.
Files changed (90) hide show
  1. package/CapacitorPluginPlaylist.podspec +17 -0
  2. package/README.md +248 -0
  3. package/android/.project +34 -0
  4. package/android/build.gradle +69 -0
  5. package/android/gradle/wrapper/gradle-wrapper.jar +0 -0
  6. package/android/gradle/wrapper/gradle-wrapper.properties +7 -0
  7. package/android/gradle.properties +22 -0
  8. package/android/gradlew +251 -0
  9. package/android/gradlew.bat +94 -0
  10. package/android/proguard-rules.pro +21 -0
  11. package/android/settings.gradle +2 -0
  12. package/android/src/androidTest/java/com/getcapacitor/android/ExampleInstrumentedTest.java +26 -0
  13. package/android/src/main/AndroidManifest.xml +4 -0
  14. package/android/src/main/java/org/dwbn/plugins/playlist/App.kt +19 -0
  15. package/android/src/main/java/org/dwbn/plugins/playlist/FakeR.kt +39 -0
  16. package/android/src/main/java/org/dwbn/plugins/playlist/OnStatusCallback.kt +34 -0
  17. package/android/src/main/java/org/dwbn/plugins/playlist/OnStatusReportListener.java +7 -0
  18. package/android/src/main/java/org/dwbn/plugins/playlist/PlaylistItemOptions.java +52 -0
  19. package/android/src/main/java/org/dwbn/plugins/playlist/PlaylistPlugin.kt +447 -0
  20. package/android/src/main/java/org/dwbn/plugins/playlist/RmxAudioErrorType.java +13 -0
  21. package/android/src/main/java/org/dwbn/plugins/playlist/RmxAudioPlayer.java +487 -0
  22. package/android/src/main/java/org/dwbn/plugins/playlist/RmxAudioStatusMessage.java +35 -0
  23. package/android/src/main/java/org/dwbn/plugins/playlist/RmxConstants.java +42 -0
  24. package/android/src/main/java/org/dwbn/plugins/playlist/TrackRemovalItem.java +12 -0
  25. package/android/src/main/java/org/dwbn/plugins/playlist/data/AudioTrack.kt +94 -0
  26. package/android/src/main/java/org/dwbn/plugins/playlist/manager/MediaControlsListener.kt +13 -0
  27. package/android/src/main/java/org/dwbn/plugins/playlist/manager/Options.kt +77 -0
  28. package/android/src/main/java/org/dwbn/plugins/playlist/manager/PlaylistManager.kt +308 -0
  29. package/android/src/main/java/org/dwbn/plugins/playlist/notification/PlaylistNotificationProvider.kt +26 -0
  30. package/android/src/main/java/org/dwbn/plugins/playlist/playlist/AudioApi.kt +114 -0
  31. package/android/src/main/java/org/dwbn/plugins/playlist/playlist/AudioPlaylistHandler.java +146 -0
  32. package/android/src/main/java/org/dwbn/plugins/playlist/playlist/BaseMediaApi.kt +36 -0
  33. package/android/src/main/java/org/dwbn/plugins/playlist/service/MediaImageProvider.kt +83 -0
  34. package/android/src/main/java/org/dwbn/plugins/playlist/service/MediaService.kt +98 -0
  35. package/android/src/main/res/.gitkeep +0 -0
  36. package/android/src/main/res/drawable/ic_closed_caption_white_24dp.xml +9 -0
  37. package/android/src/main/res/drawable/ic_demo_icon_adaptive.xml +15 -0
  38. package/android/src/main/res/drawable/ic_launcher_background.xml +48 -0
  39. package/android/src/main/res/drawable/ic_launcher_foreground.xml +22 -0
  40. package/android/src/main/res/drawable/ic_notification_icon.png +0 -0
  41. package/android/src/main/res/layout/bridge_layout_main.xml +15 -0
  42. package/android/src/main/res/values/colors.xml +3 -0
  43. package/android/src/main/res/values/strings.xml +3 -0
  44. package/android/src/main/res/values/styles.xml +3 -0
  45. package/android/src/test/java/com/getcapacitor/ExampleUnitTest.java +18 -0
  46. package/dist/docs.json +2071 -0
  47. package/dist/esm/Constants.d.ts +164 -0
  48. package/dist/esm/Constants.js +175 -0
  49. package/dist/esm/Constants.js.map +1 -0
  50. package/dist/esm/RmxAudioPlayer.d.ts +181 -0
  51. package/dist/esm/RmxAudioPlayer.js +344 -0
  52. package/dist/esm/RmxAudioPlayer.js.map +1 -0
  53. package/dist/esm/definitions.d.ts +78 -0
  54. package/dist/esm/definitions.js +2 -0
  55. package/dist/esm/definitions.js.map +1 -0
  56. package/dist/esm/index.d.ts +5 -0
  57. package/dist/esm/index.js +6 -0
  58. package/dist/esm/index.js.map +1 -0
  59. package/dist/esm/interfaces.d.ts +246 -0
  60. package/dist/esm/interfaces.js +2 -0
  61. package/dist/esm/interfaces.js.map +1 -0
  62. package/dist/esm/plugin.d.ts +3 -0
  63. package/dist/esm/plugin.js +13 -0
  64. package/dist/esm/plugin.js.map +1 -0
  65. package/dist/esm/utils.d.ts +15 -0
  66. package/dist/esm/utils.js +48 -0
  67. package/dist/esm/utils.js.map +1 -0
  68. package/dist/esm/web.d.ts +54 -0
  69. package/dist/esm/web.js +409 -0
  70. package/dist/esm/web.js.map +1 -0
  71. package/dist/plugin.cjs.js +993 -0
  72. package/dist/plugin.cjs.js.map +1 -0
  73. package/dist/plugin.js +996 -0
  74. package/dist/plugin.js.map +1 -0
  75. package/ios/Plugin/AVBidirectionalQueuePlayer.swift +269 -0
  76. package/ios/Plugin/AudioTrack.swift +63 -0
  77. package/ios/Plugin/Constants.swift +39 -0
  78. package/ios/Plugin/DispatchQueue.swift +47 -0
  79. package/ios/Plugin/Info.plist +24 -0
  80. package/ios/Plugin/Plugin.h +10 -0
  81. package/ios/Plugin/Plugin.m +30 -0
  82. package/ios/Plugin/Plugin.swift +208 -0
  83. package/ios/Plugin/RmxAudioPlayer.swift +1150 -0
  84. package/ios/Plugin.xcodeproj/project.pbxproj +574 -0
  85. package/ios/Plugin.xcworkspace/contents.xcworkspacedata +10 -0
  86. package/ios/Plugin.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -0
  87. package/ios/PluginTests/Info.plist +22 -0
  88. package/ios/PluginTests/PluginTests.swift +35 -0
  89. package/ios/Podfile +16 -0
  90. package/package.json +89 -0
@@ -0,0 +1,246 @@
1
+ import { RmxAudioErrorType, RmxAudioStatusMessage } from './Constants';
2
+ /**
3
+ * Callback function for the on(eventName) handlers
4
+ */
5
+ export declare type AudioPlayerEventHandler = (args?: any) => void;
6
+ /**
7
+ * @internal
8
+ * The collection of event handlers currently held by the plugin
9
+ */
10
+ export interface AudioPlayerEventHandlers {
11
+ [key: string]: AudioPlayerEventHandler[];
12
+ }
13
+ export declare type PlaylistStatusChangeCallback = (data: PlaylistStatusChangeCallbackArg) => void;
14
+ export interface PlaylistStatusChangeCallbackArg {
15
+ action: string;
16
+ status: OnStatusCallbackData;
17
+ }
18
+ export interface AudioTrackOptions {
19
+ playFromPosition: number;
20
+ startPaused: boolean;
21
+ retainPosition: boolean;
22
+ playFromId: string;
23
+ }
24
+ /**
25
+ * Options governing the overall behavior of the audio player plugin
26
+ */
27
+ export interface AudioPlayerOptions {
28
+ /**
29
+ * Should the plugin's javascript dump the status message stream to the javascript console?
30
+ */
31
+ verbose?: boolean;
32
+ /**
33
+ * If true, when pausing a live stream, play will continue from the LIVE POSITION (e.g. the stream
34
+ * jumps forward to the current point in time, rather than picking up where it left off when you paused).
35
+ * If false, the stream will continue where you paused. The drawback of doing this is that when the audio
36
+ * buffer fills, it will jump forward to the current point in time, cause a disjoint in playback.
37
+ *
38
+ * Default is true.
39
+ */
40
+ resetStreamOnPause?: boolean;
41
+ /**
42
+ * Further options for notifications
43
+ */
44
+ options?: NotificationOptions;
45
+ }
46
+ export interface NotificationOptions {
47
+ icon?: string;
48
+ }
49
+ /**
50
+ * Options governing how the items are managed when using setPlaylistItems
51
+ * to update the playlist. This is typically useful if you are retaining items
52
+ * that were in the previous list.
53
+ */
54
+ export interface PlaylistItemOptions {
55
+ /**
56
+ * If true, the plugin will continue playback from the current playback position after
57
+ * setting the items to the playlist.
58
+ */
59
+ retainPosition?: boolean;
60
+ /**
61
+ * If retainPosition is true, this value will tell the plugin the exact time to start from,
62
+ * rather than letting the plugin decide based on current playback.
63
+ */
64
+ playFromPosition?: number;
65
+ /**
66
+ * If retainPosition is true, this value will tell the plugin the uid of the "current" item to start from,
67
+ * rather than letting the plugin decide based on current playback.
68
+ */
69
+ playFromId?: string;
70
+ /**
71
+ * If playback should immediately begin when calling setPlaylistItems on the plugin.
72
+ * Default is false;
73
+ */
74
+ startPaused?: boolean;
75
+ }
76
+ /**
77
+ * An audio track for playback by the playlist.
78
+ */
79
+ export interface AudioTrack {
80
+ /**
81
+ * This item is a streaming asset. Make sure this is set to true for stream URLs,
82
+ * otherwise you will get odd behavior when the asset is paused.
83
+ */
84
+ isStream?: boolean;
85
+ /**
86
+ * trackId is optional and if not passed in, an auto-generated UUID will be used.
87
+ */
88
+ trackId?: string;
89
+ /**
90
+ * URL of the asset; can be local, a URL, or a streaming URL.
91
+ * If the asset is a stream, make sure that isStream is set to true,
92
+ * otherwise the plugin can't properly handle the item's buffer.
93
+ */
94
+ assetUrl: string;
95
+ /**
96
+ * The local or remote URL to an image asset to be shown for this track.
97
+ * If this is null, the plugin's default image is used.
98
+ */
99
+ albumArt?: string;
100
+ /**
101
+ * The track's artist
102
+ */
103
+ artist: string;
104
+ /**
105
+ * Album the track belongs to
106
+ */
107
+ album: string;
108
+ /**
109
+ * Title of the track
110
+ */
111
+ title: string;
112
+ }
113
+ /**
114
+ * Encapsulates the fields you can pass to the plugin to remove a track.
115
+ * You can either remove a track by its ID if you know it, or by index if you know it;
116
+ * Index will be preferred if both index and ID are passed.
117
+ */
118
+ export interface AudioTrackRemoval {
119
+ /**
120
+ * The track ID to remove
121
+ */
122
+ trackId?: string;
123
+ /**
124
+ * The index of a track to remove.
125
+ */
126
+ trackIndex?: number;
127
+ }
128
+ /**
129
+ * Encapsulates the data received by an onStatus callback
130
+ */
131
+ export interface OnStatusCallbackData {
132
+ /**
133
+ * The ID of this track. If the track is null or has completed, this value is "NONE"
134
+ * If the playlist is completed, this value is "INVALID"
135
+ */
136
+ trackId: string;
137
+ /**
138
+ * The type of status update
139
+ */
140
+ msgType: RmxAudioStatusMessage;
141
+ /**
142
+ * The status payload. For all updates except ERROR, the data package is described by OnStatusCallbackUpdateData.
143
+ * For Errors, the data is shaped as OnStatusErrorCallbackData
144
+ */
145
+ value: OnStatusCallbackUpdateData | OnStatusTrackChangedData | OnStatusErrorCallbackData;
146
+ }
147
+ /**
148
+ * Reports information about the playlist state when a track changes.
149
+ * Includes the new track, its index, and the state of the playlist.
150
+ */
151
+ export interface OnStatusTrackChangedData {
152
+ /**
153
+ * The new track that has been selected. May be null if you are at the end of the playlist,
154
+ * or the playlist has been emptied.
155
+ */
156
+ currentItem: AudioTrack;
157
+ /**
158
+ * The 0-based index of the new track. If the playlist has ended or been cleared, this will be -1.
159
+ */
160
+ currentIndex: number;
161
+ /**
162
+ * Indicates whether the playlist is now currently at the last item in the list.
163
+ */
164
+ isAtEnd: boolean;
165
+ /**
166
+ * Indicates whether the playlist is now at the first item in the list
167
+ */
168
+ isAtBeginning: boolean;
169
+ /**
170
+ * Indicates if there are additional playlist items after the current item.
171
+ */
172
+ hasNext: boolean;
173
+ /**
174
+ * Indicates if there are any items before this one in the playlist.
175
+ */
176
+ hasPrevious: boolean;
177
+ }
178
+ /**
179
+ * Contains the current track status as of the moment an onStatus update event is emitted.
180
+ */
181
+ export interface OnStatusCallbackUpdateData {
182
+ /**
183
+ * The ID of this track corresponding to this event. If the track is null or has completed, this value is "NONE".
184
+ * This will happen when skipping to the beginning or end of the playlist.
185
+ * If the playlist is completed, this value is "INVALID"
186
+ */
187
+ trackId: string;
188
+ /**
189
+ * Boolean indicating whether this is a streaming track.
190
+ */
191
+ isStream: boolean;
192
+ /**
193
+ * The current index of the track in the playlist.
194
+ */
195
+ currentIndex: number;
196
+ /**
197
+ * The current status of the track, as a string. This is used
198
+ * to summarize the various event states that a track can be in; e.g. "playing" is true for any number
199
+ * of track statuses. The Javascript interface takes care of this for you; this field is here only for reference.
200
+ */
201
+ status: 'unknown' | 'ready' | 'error' | 'playing' | 'loading' | 'paused';
202
+ /**
203
+ * Current playback position of the reported track.
204
+ */
205
+ currentPosition: number;
206
+ /**
207
+ * The known duration of the reported track. For streams or malformed MP3's, this value will be 0.
208
+ */
209
+ duration: number;
210
+ /**
211
+ * Progress of track playback, as a percent, in the range 0 - 100
212
+ */
213
+ playbackPercent: number;
214
+ /**
215
+ * Buffering progress of the track, as a percent, in the range 0 - 100
216
+ */
217
+ bufferPercent: number;
218
+ /**
219
+ * The starting position of the buffering progress. For now, this is always reported as 0.
220
+ */
221
+ bufferStart: number;
222
+ /**
223
+ * The maximum position, in seconds, of the track buffer. For now, only the buffer with the maximum
224
+ * playback position is reported, even if there are other segments (due to seeking, for example).
225
+ * Practically speaking you don't need to worry about that, as in both implementations the
226
+ * minor gaps are automatically filled in by the underlying players.
227
+ */
228
+ bufferEnd: number;
229
+ }
230
+ /**
231
+ * Represents an error reported by the onStatus callback.
232
+ */
233
+ export interface OnStatusErrorCallbackData {
234
+ /**
235
+ * Error code
236
+ */
237
+ code: RmxAudioErrorType;
238
+ /**
239
+ * The error, as a message
240
+ */
241
+ message: string;
242
+ }
243
+ /**
244
+ * Function declaration for onStatus event handlers
245
+ */
246
+ export declare type OnStatusCallback = (info: OnStatusCallbackData) => void;
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=interfaces.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../src/interfaces.ts"],"names":[],"mappings":""}
@@ -0,0 +1,3 @@
1
+ import type { PlaylistPlugin } from './definitions';
2
+ declare const Playlist: PlaylistPlugin;
3
+ export { Playlist };
@@ -0,0 +1,13 @@
1
+ import { registerPlugin } from '@capacitor/core';
2
+ // todo: find out why we get imported twice
3
+ let playListWebInstance;
4
+ const Playlist = registerPlugin('Playlist', {
5
+ web: () => import('./web').then(m => {
6
+ if (!playListWebInstance) {
7
+ playListWebInstance = new m.PlaylistWeb();
8
+ }
9
+ return playListWebInstance;
10
+ }),
11
+ });
12
+ export { Playlist };
13
+ //# sourceMappingURL=plugin.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugin.js","sourceRoot":"","sources":["../../src/plugin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,cAAc,EAAC,MAAM,iBAAiB,CAAC;AAI/C,2CAA2C;AAC3C,IAAI,mBAAmC,CAAC;AACxC,MAAM,QAAQ,GAAG,cAAc,CAAiB,UAAU,EAAE;IACxD,GAAG,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE;QAChC,IAAI,CAAC,mBAAmB,EAAE,CAAC;YACvB,mBAAmB,GAAG,IAAI,CAAC,CAAC,WAAW,EAAE,CAAC;QAC9C,CAAC;QACD,OAAO,mBAAmB,CAAC;IAC/B,CAAC,CAAC;CACL,CAAC,CAAC;AACH,OAAO,EAAC,QAAQ,EAAC,CAAC"}
@@ -0,0 +1,15 @@
1
+ import { AudioTrack } from './interfaces';
2
+ /**
3
+ * Validates the list of AudioTrack items to ensure they are valid.
4
+ * Used internally but you can call this if you need to :)
5
+ *
6
+ * @param items The AudioTrack items to validate
7
+ */
8
+ export declare const validateTracks: (items: AudioTrack[]) => AudioTrack[];
9
+ /**
10
+ * Validate a single track and ensure it is valid for playback.
11
+ * Used internally but you can call this if you need to :)
12
+ *
13
+ * @param track The AudioTrack to validate
14
+ */
15
+ export declare const validateTrack: (track: AudioTrack) => AudioTrack | null;
@@ -0,0 +1,48 @@
1
+ /**
2
+ * Validates the list of AudioTrack items to ensure they are valid.
3
+ * Used internally but you can call this if you need to :)
4
+ *
5
+ * @param items The AudioTrack items to validate
6
+ */
7
+ export const validateTracks = (items) => {
8
+ if (!items || !Array.isArray(items)) {
9
+ return [];
10
+ }
11
+ return items.map(validateTrack).filter(x => !!x); // may produce an empty array!
12
+ };
13
+ /**
14
+ * Validate a single track and ensure it is valid for playback.
15
+ * Used internally but you can call this if you need to :)
16
+ *
17
+ * @param track The AudioTrack to validate
18
+ */
19
+ export const validateTrack = (track) => {
20
+ if (!track) {
21
+ return null;
22
+ }
23
+ // For now we will rely on TS to do the heavy lifting, but we can add a validation here
24
+ // that all the required fields are valid. For now we just take care of the unique ID.
25
+ track.trackId = track.trackId || generateUUID();
26
+ return track;
27
+ };
28
+ /**
29
+ * 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.
30
+ */
31
+ const generateUUID = () => {
32
+ var d = new Date().getTime();
33
+ if (typeof performance !== 'undefined' && typeof performance.now === 'function') {
34
+ d += performance.now(); //use high-precision timer if available
35
+ }
36
+ // There are better ways to do this in ES6, we are intentionally avoiding the import
37
+ // of an ES6 polyfill here.
38
+ const template = 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx';
39
+ return [].slice.call(template).map(function (c) {
40
+ if (c === '-' || c === '4') {
41
+ return c;
42
+ }
43
+ var r = (d + Math.random() * 16) % 16 | 0;
44
+ d = Math.floor(d / 16);
45
+ return (c === 'x' ? r : (r & 0x3 | 0x8)).toString(16);
46
+ }).join('');
47
+ };
48
+ //# sourceMappingURL=utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/utils.ts"],"names":[],"mappings":"AAEA;;;;;GAKG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,KAAmB,EAAE,EAAE;IAClD,IAAI,CAAC,KAAK,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;QAClC,OAAO,EAAE,CAAC;IACd,CAAC;IACD,OAAO,KAAK,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAiB,CAAC,CAAC,8BAA8B;AACpG,CAAC,CAAC;AAEF;;;;;GAKG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,KAAiB,EAAE,EAAE;IAC/C,IAAI,CAAC,KAAK,EAAE,CAAC;QACT,OAAO,IAAI,CAAC;IAChB,CAAC;IACD,uFAAuF;IACvF,sFAAsF;IACtF,KAAK,CAAC,OAAO,GAAG,KAAK,CAAC,OAAO,IAAI,YAAY,EAAE,CAAC;IAChD,OAAO,KAAK,CAAC;AACjB,CAAC,CAAC;AAEF;;GAEG;AACH,MAAM,YAAY,GAAG,GAAG,EAAE;IACtB,IAAI,CAAC,GAAG,IAAI,IAAI,EAAE,CAAC,OAAO,EAAE,CAAC;IAC7B,IAAI,OAAO,WAAW,KAAK,WAAW,IAAI,OAAO,WAAW,CAAC,GAAG,KAAK,UAAU,EAAE,CAAC;QAC9E,CAAC,IAAI,WAAW,CAAC,GAAG,EAAE,CAAC,CAAC,uCAAuC;IACnE,CAAC;IACD,oFAAoF;IACpF,2BAA2B;IAC3B,MAAM,QAAQ,GAAG,sCAAsC,CAAC;IACxD,OAAmB,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAE,CAAC,GAAG,CAAC,UAAS,CAAC;QACtD,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,GAAG,EAAE,CAAC;YACzB,OAAO,CAAC,CAAC;QACb,CAAC;QACD,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,IAAI,CAAC,MAAM,EAAE,GAAG,EAAE,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;QAC1C,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC;QACvB,OAAO,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,GAAG,GAAG,GAAG,CAAC,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;IAC1D,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AAChB,CAAC,CAAC"}
@@ -0,0 +1,54 @@
1
+ import { WebPlugin } from '@capacitor/core';
2
+ import { RmxAudioStatusMessage } from './Constants';
3
+ import { AddAllItemOptions, AddItemOptions, PlayByIdOptions, PlayByIndexOptions, PlaylistOptions, PlaylistPlugin, RemoveItemOptions, RemoveItemsOptions, SeekToOptions, SelectByIdOptions, SelectByIndexOptions, SetLoopOptions, SetPlaybackRateOptions, SetPlaybackVolumeOptions } from './definitions';
4
+ import { AudioPlayerOptions, AudioTrack } from './interfaces';
5
+ export declare class PlaylistWeb extends WebPlugin implements PlaylistPlugin {
6
+ protected audio: HTMLAudioElement | undefined;
7
+ protected playlistItems: AudioTrack[];
8
+ protected loop: boolean;
9
+ protected options: AudioPlayerOptions;
10
+ protected currentTrack: AudioTrack | null;
11
+ protected lastState: string;
12
+ addAllItems(options: AddAllItemOptions): Promise<void>;
13
+ addItem(options: AddItemOptions): Promise<void>;
14
+ clearAllItems(): Promise<void>;
15
+ getPlaylist(): Promise<{
16
+ items: AudioTrack[];
17
+ }>;
18
+ initialize(): Promise<void>;
19
+ pause(): Promise<void>;
20
+ play(): Promise<void>;
21
+ playTrackById(options: PlayByIdOptions): Promise<void>;
22
+ playTrackByIndex(options: PlayByIndexOptions): Promise<void>;
23
+ release(): Promise<void>;
24
+ create(): Promise<void>;
25
+ removeItem(options: RemoveItemOptions): Promise<void>;
26
+ removeItems(options: RemoveItemsOptions): Promise<void>;
27
+ seekTo(options: SeekToOptions): Promise<void>;
28
+ selectTrackById(options: SelectByIdOptions): Promise<void>;
29
+ selectTrackByIndex(options: SelectByIndexOptions): Promise<void>;
30
+ setLoop(options: SetLoopOptions): Promise<void>;
31
+ setOptions(options: AudioPlayerOptions): Promise<void>;
32
+ setPlaybackVolume(options: SetPlaybackVolumeOptions): Promise<void>;
33
+ setPlaylistItems(options: PlaylistOptions): Promise<void>;
34
+ skipForward(): Promise<void>;
35
+ skipBack(): Promise<void>;
36
+ setPlaybackRate(options: SetPlaybackRateOptions): Promise<void>;
37
+ setMediaSessionRemoteControlMetadata(): Promise<void>;
38
+ mediaSessionControlsHandler(actionDetails: MediaSessionActionDetails): Promise<void>;
39
+ registerHtmlListeners(position?: number): void;
40
+ protected getCurrentTrackId(): string | undefined;
41
+ protected getCurrentIndex(): number;
42
+ protected getCurrentTrackStatus(currentState: string): {
43
+ trackId: string | undefined;
44
+ isStream: boolean;
45
+ currentIndex: number;
46
+ status: string;
47
+ currentPosition: number;
48
+ duration: number;
49
+ };
50
+ protected setCurrent(item: AudioTrack, position?: number, forceAutoplay?: boolean): Promise<void>;
51
+ protected updateStatus(msgType: RmxAudioStatusMessage, value: any, trackId?: string): void;
52
+ private hlsLoaded;
53
+ protected loadHlsJs(): Promise<unknown>;
54
+ }