capacitor-plugin-playlist 0.4.1 → 0.4.2

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 (38) hide show
  1. package/android/.gradle/8.2.1/checksums/checksums.lock +0 -0
  2. package/android/.gradle/8.2.1/checksums/md5-checksums.bin +0 -0
  3. package/android/.gradle/8.2.1/checksums/sha1-checksums.bin +0 -0
  4. package/android/.gradle/8.2.1/dependencies-accessors/dependencies-accessors.lock +0 -0
  5. package/android/.gradle/8.2.1/dependencies-accessors/gc.properties +0 -0
  6. package/android/.gradle/8.2.1/executionHistory/executionHistory.bin +0 -0
  7. package/android/.gradle/8.2.1/executionHistory/executionHistory.lock +0 -0
  8. package/android/.gradle/8.2.1/fileChanges/last-build.bin +0 -0
  9. package/android/.gradle/8.2.1/fileHashes/fileHashes.bin +0 -0
  10. package/android/.gradle/8.2.1/fileHashes/fileHashes.lock +0 -0
  11. package/android/.gradle/8.2.1/gc.properties +0 -0
  12. package/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock +0 -0
  13. package/android/.gradle/buildOutputCleanup/cache.properties +2 -2
  14. package/android/.gradle/buildOutputCleanup/outputFiles.bin +0 -0
  15. package/android/.gradle/file-system.probe +0 -0
  16. package/android/bin/.gradle/8.2.1/checksums/checksums.lock +0 -0
  17. package/android/bin/.gradle/8.2.1/checksums/md5-checksums.bin +0 -0
  18. package/android/bin/.gradle/8.2.1/checksums/sha1-checksums.bin +0 -0
  19. package/android/bin/.gradle/8.2.1/dependencies-accessors/dependencies-accessors.lock +0 -0
  20. package/android/bin/.gradle/8.2.1/dependencies-accessors/gc.properties +0 -0
  21. package/android/bin/.gradle/8.2.1/executionHistory/executionHistory.bin +0 -0
  22. package/android/bin/.gradle/8.2.1/executionHistory/executionHistory.lock +0 -0
  23. package/android/bin/.gradle/8.2.1/fileChanges/last-build.bin +0 -0
  24. package/android/bin/.gradle/8.2.1/fileHashes/fileHashes.bin +0 -0
  25. package/android/bin/.gradle/8.2.1/fileHashes/fileHashes.lock +0 -0
  26. package/android/bin/.gradle/8.2.1/gc.properties +0 -0
  27. package/android/bin/.gradle/buildOutputCleanup/buildOutputCleanup.lock +0 -0
  28. package/android/bin/.gradle/buildOutputCleanup/cache.properties +2 -2
  29. package/android/bin/.gradle/buildOutputCleanup/outputFiles.bin +0 -0
  30. package/android/bin/.gradle/file-system.probe +0 -0
  31. package/android/bin/src/main/java/org/dwbn/plugins/playlist/App.kt +2 -3
  32. package/android/bin/src/main/java/org/dwbn/plugins/playlist/PlaylistPlugin.kt +49 -2
  33. package/android/bin/src/main/java/org/dwbn/plugins/playlist/manager/PlaylistManager.kt +1 -1
  34. package/android/bin/src/main/java/org/dwbn/plugins/playlist/service/MediaService.kt +2 -1
  35. package/android/src/main/java/org/dwbn/plugins/playlist/manager/PlaylistManager.kt +1 -1
  36. package/dist/docs.json +537 -633
  37. package/package.json +2 -2
  38. package/android/bin/.settings/org.eclipse.buildship.core.prefs +0 -13
File without changes
@@ -1,2 +1,2 @@
1
- #Sat Jul 13 00:28:49 CEST 2024
2
- gradle.version=8.0.2
1
+ #Sat Jul 13 16:08:50 CEST 2024
2
+ gradle.version=8.2.1
Binary file
File without changes
@@ -1,2 +1,2 @@
1
- #Sat Jul 13 00:28:49 CEST 2024
2
- gradle.version=8.0.2
1
+ #Sat Jul 13 16:08:50 CEST 2024
2
+ gradle.version=8.2.1
@@ -17,15 +17,14 @@ class App : Application() {
17
17
  private lateinit var _playlistManager: PlaylistManager;
18
18
  val playlistManager get() = _playlistManager
19
19
 
20
- fun resetPlaylistManager() {
20
+ fun initPlaylistManager() {
21
21
  _playlistManager = PlaylistManager(this)
22
22
  }
23
23
 
24
24
  override fun onCreate() {
25
- resetPlaylistManager()
26
25
  super.onCreate()
27
26
 
28
- configureExoMedia()
27
+ //configureExoMedia()
29
28
  }
30
29
 
31
30
  private fun configureExoMedia() {
@@ -17,19 +17,23 @@ class PlaylistPlugin : Plugin(), OnStatusReportListener {
17
17
  private var resetStreamOnPause = true
18
18
 
19
19
  override fun load() {
20
+ return;
20
21
  audioPlayerImpl = RmxAudioPlayer(this, (this.context.applicationContext as App))
21
22
  }
22
23
 
23
24
  @PluginMethod
24
25
  fun initialize(call: PluginCall) {
26
+ call.resolve()
27
+ return;
25
28
  statusCallback = OnStatusCallback(this)
26
29
  onStatus(RmxAudioStatusMessage.RMXSTATUS_REGISTER, "INIT", null)
27
30
  Log.i(TAG, "Initialized...")
28
31
  audioPlayerImpl!!.resume()
29
- call.resolve()
30
32
  }
31
33
  @PluginMethod
32
34
  fun setOptions(call: PluginCall) {
35
+ call.resolve()
36
+ return;
33
37
  val options: JSObject = call.getObject("options") ?: JSObject()
34
38
  resetStreamOnPause = options.optBoolean("resetStreamOnPause", this.resetStreamOnPause)
35
39
  Log.i("AudioPlayerOptions", options.toString())
@@ -40,6 +44,8 @@ class PlaylistPlugin : Plugin(), OnStatusReportListener {
40
44
 
41
45
  @PluginMethod
42
46
  fun release(call: PluginCall) {
47
+ call.resolve()
48
+ return;
43
49
  destroyResources()
44
50
  call.resolve()
45
51
  Log.i(TAG,"released")
@@ -47,6 +53,8 @@ class PlaylistPlugin : Plugin(), OnStatusReportListener {
47
53
 
48
54
  @PluginMethod
49
55
  fun setLoop(call: PluginCall) {
56
+ call.resolve()
57
+ return;
50
58
  val loop: Boolean = call.getBoolean("loop", audioPlayerImpl!!.playlistManager.loop)!!
51
59
  audioPlayerImpl!!.playlistManager.loop = loop
52
60
  call.resolve()
@@ -55,6 +63,8 @@ class PlaylistPlugin : Plugin(), OnStatusReportListener {
55
63
 
56
64
  @PluginMethod
57
65
  fun setPlaylistItems(call: PluginCall) {
66
+ call.resolve()
67
+ return;
58
68
  val items: JSArray = call.getArray("items")
59
69
  val optionsArgs: JSONObject = call.getObject("options")
60
70
  val options = PlaylistItemOptions(optionsArgs)
@@ -74,10 +84,12 @@ class PlaylistPlugin : Plugin(), OnStatusReportListener {
74
84
 
75
85
  @PluginMethod
76
86
  fun addItem(call: PluginCall) {
87
+ call.resolve()
88
+ return;
77
89
  val item: JSONObject = call.getObject("item")
78
90
  val playerItem: AudioTrack? = getTrackItem(item)
79
91
  audioPlayerImpl!!.getPlaylistManager().addItem(playerItem)
80
-
92
+ x
81
93
 
82
94
  if (playerItem?.trackId != null) {
83
95
  onStatus(RmxAudioStatusMessage.RMXSTATUS_ITEM_ADDED, playerItem.trackId, playerItem.toDict())
@@ -88,6 +100,8 @@ class PlaylistPlugin : Plugin(), OnStatusReportListener {
88
100
 
89
101
  @PluginMethod
90
102
  fun addAllItems(call: PluginCall) {
103
+ call.resolve()
104
+ return;
91
105
  val items: JSONArray = call.getArray("items")
92
106
  val trackItems = getTrackItems(items)
93
107
  audioPlayerImpl!!.playlistManager.addAllItems(trackItems)
@@ -103,6 +117,8 @@ class PlaylistPlugin : Plugin(), OnStatusReportListener {
103
117
 
104
118
  @PluginMethod
105
119
  fun removeItem(call: PluginCall) {
120
+ call.resolve()
121
+ return;
106
122
  val trackIndex: Int = call.getInt("index", -1)!!
107
123
  val trackId: String = call.getString("id", "")!!
108
124
  Log.i(TAG,"removeItem trackIn" )
@@ -119,6 +135,8 @@ class PlaylistPlugin : Plugin(), OnStatusReportListener {
119
135
 
120
136
  @PluginMethod
121
137
  fun removeItems(call: PluginCall) {
138
+ call.resolve()
139
+ return;
122
140
  val items: JSONArray = call.getArray("items")
123
141
  var removed = 0
124
142
 
@@ -146,6 +164,8 @@ class PlaylistPlugin : Plugin(), OnStatusReportListener {
146
164
 
147
165
  @PluginMethod
148
166
  fun clearAllItems(call: PluginCall) {
167
+ call.resolve()
168
+ return;
149
169
  audioPlayerImpl!!.playlistManager.clearItems()
150
170
 
151
171
  onStatus(RmxAudioStatusMessage.RMXSTATUS_PLAYLIST_CLEARED, "INVALID", null)
@@ -156,6 +176,8 @@ class PlaylistPlugin : Plugin(), OnStatusReportListener {
156
176
 
157
177
  @PluginMethod
158
178
  fun play(call: PluginCall) {
179
+ call.resolve()
180
+ return;
159
181
  if (audioPlayerImpl!!.playlistManager.playlistHandler != null) {
160
182
  val isPlaying = (audioPlayerImpl!!.playlistManager.playlistHandler?.currentMediaPlayer != null
161
183
  && audioPlayerImpl!!.playlistManager.playlistHandler?.currentMediaPlayer?.isPlaying!!)
@@ -175,6 +197,8 @@ class PlaylistPlugin : Plugin(), OnStatusReportListener {
175
197
 
176
198
  @PluginMethod
177
199
  fun playTrackByIndex(call: PluginCall) {
200
+ call.resolve()
201
+ return;
178
202
  val index: Int = call.getInt("index", audioPlayerImpl!!.playlistManager.currentPosition)!!
179
203
  val seekPosition = (call.getInt("position", 0)!! * 1000.0).toLong()
180
204
 
@@ -188,6 +212,8 @@ class PlaylistPlugin : Plugin(), OnStatusReportListener {
188
212
 
189
213
  @PluginMethod
190
214
  fun playTrackById(call: PluginCall) {
215
+ call.resolve()
216
+ return;
191
217
  val id: String = call.getString("id")!!
192
218
  if ("" != id) {
193
219
  // alternatively we could search for the item and set the current index to that item.
@@ -204,6 +230,8 @@ class PlaylistPlugin : Plugin(), OnStatusReportListener {
204
230
 
205
231
  @PluginMethod
206
232
  fun selectTrackByIndex(call: PluginCall) {
233
+ call.resolve()
234
+ return;
207
235
  val index: Int = call.getInt("index", audioPlayerImpl!!.playlistManager.currentPosition)!!
208
236
 
209
237
  audioPlayerImpl!!.playlistManager.currentPosition = index
@@ -220,6 +248,8 @@ class PlaylistPlugin : Plugin(), OnStatusReportListener {
220
248
 
221
249
  @PluginMethod
222
250
  fun selectTrackById(call: PluginCall) {
251
+ call.resolve()
252
+ return;
223
253
  val id: String = call.getString("id")!!
224
254
  if ("" != id) {
225
255
  // alternatively we could search for the item and set the current index to that item.
@@ -237,6 +267,8 @@ class PlaylistPlugin : Plugin(), OnStatusReportListener {
237
267
 
238
268
  @PluginMethod
239
269
  fun pause(call: PluginCall) {
270
+ call.resolve()
271
+ return;
240
272
  audioPlayerImpl!!.playlistManager.invokePausePlay()
241
273
 
242
274
  call.resolve()
@@ -246,6 +278,8 @@ class PlaylistPlugin : Plugin(), OnStatusReportListener {
246
278
 
247
279
  @PluginMethod
248
280
  fun skipForward(call: PluginCall) {
281
+ call.resolve()
282
+ return;
249
283
  audioPlayerImpl!!.playlistManager.invokeNext()
250
284
 
251
285
  call.resolve()
@@ -255,6 +289,8 @@ class PlaylistPlugin : Plugin(), OnStatusReportListener {
255
289
 
256
290
  @PluginMethod
257
291
  fun skipBack(call: PluginCall) {
292
+ call.resolve()
293
+ return;
258
294
  audioPlayerImpl!!.playlistManager.invokePrevious()
259
295
 
260
296
  call.resolve()
@@ -264,6 +300,8 @@ class PlaylistPlugin : Plugin(), OnStatusReportListener {
264
300
 
265
301
  @PluginMethod
266
302
  fun seekTo(call: PluginCall) {
303
+ call.resolve()
304
+ return;
267
305
  var position: Long = 0
268
306
  val progress: MediaProgress? = audioPlayerImpl!!.playlistManager.currentProgress
269
307
  if (progress != null) {
@@ -285,6 +323,8 @@ class PlaylistPlugin : Plugin(), OnStatusReportListener {
285
323
 
286
324
  @PluginMethod
287
325
  fun setPlaybackRate(call: PluginCall) {
326
+ call.resolve()
327
+ return;
288
328
  val speed = call.getFloat("rate", audioPlayerImpl!!.playlistManager.getPlaybackSpeed())!!
289
329
  audioPlayerImpl!!.playlistManager.setPlaybackSpeed(speed)
290
330
 
@@ -295,6 +335,8 @@ class PlaylistPlugin : Plugin(), OnStatusReportListener {
295
335
 
296
336
  @PluginMethod
297
337
  fun setVolume(call: PluginCall) {
338
+ call.resolve()
339
+ return;
298
340
  val volume = call.getFloat("volume", audioPlayerImpl!!.volume)!!
299
341
  audioPlayerImpl!!.volume = volume
300
342
 
@@ -306,10 +348,12 @@ class PlaylistPlugin : Plugin(), OnStatusReportListener {
306
348
  override fun handleOnDestroy() {
307
349
  Log.d(TAG, "Plugin destroy")
308
350
  super.handleOnDestroy()
351
+ return;
309
352
  destroyResources()
310
353
  }
311
354
 
312
355
  override fun onError(errorCode: RmxAudioErrorType?, trackId: String?, message: String?) {
356
+ return;
313
357
  if (statusCallback == null) {
314
358
  return
315
359
  }
@@ -318,6 +362,7 @@ class PlaylistPlugin : Plugin(), OnStatusReportListener {
318
362
  }
319
363
 
320
364
  override fun onStatus(what: RmxAudioStatusMessage, trackId: String?, param: JSONObject?) {
365
+ return;
321
366
  if (statusCallback == null) {
322
367
  return
323
368
  }
@@ -325,6 +370,7 @@ class PlaylistPlugin : Plugin(), OnStatusReportListener {
325
370
  }
326
371
 
327
372
  private fun destroyResources() {
373
+ return;
328
374
  statusCallback = null
329
375
  audioPlayerImpl!!.playlistManager.clearItems()
330
376
  }
@@ -351,6 +397,7 @@ class PlaylistPlugin : Plugin(), OnStatusReportListener {
351
397
  }
352
398
 
353
399
  fun emit(name: String, data: JSObject) {
400
+ return;
354
401
  this.notifyListeners(name, data, true)
355
402
  }
356
403
  }
@@ -64,7 +64,7 @@ class PlaylistManager(application: Application) :
64
64
  */
65
65
  override val isNextAvailable: Boolean
66
66
  get() {
67
- if (itemCount == 1) {
67
+ if (itemCount <= 1) {
68
68
  return false;
69
69
  }
70
70
  val isAtEnd = currentPosition + 1 >= itemCount
@@ -16,6 +16,7 @@ import org.dwbn.plugins.playlist.service.MediaImageProvider.OnImageUpdatedListen
16
16
  class MediaService : BasePlaylistService<AudioTrack, PlaylistManager>() {
17
17
  override fun onCreate() {
18
18
  super.onCreate()
19
+ return;
19
20
  // Adds the audio player implementation, otherwise there's nothing to play media with
20
21
  val newAudio = AudioApi(applicationContext)
21
22
  newAudio.addErrorListener(playlistManager)
@@ -24,7 +25,7 @@ class MediaService : BasePlaylistService<AudioTrack, PlaylistManager>() {
24
25
 
25
26
  override fun onDestroy() {
26
27
  super.onDestroy()
27
-
28
+ return;
28
29
  // Releases and clears all the MediaPlayersMediaImageProvider
29
30
  for (player in playlistManager.mediaPlayers) {
30
31
  player.release()
@@ -64,7 +64,7 @@ class PlaylistManager(application: Application) :
64
64
  */
65
65
  override val isNextAvailable: Boolean
66
66
  get() {
67
- if (itemCount == 1) {
67
+ if (itemCount <= 1) {
68
68
  return false;
69
69
  }
70
70
  val isAtEnd = currentPosition + 1 >= itemCount