Rolamix / cordova-plugin-playlist

🎶 A Cordova plugin for Android and iOS with native support for audio playlists, background support, and lock screen controls 🎶
MIT License
32 stars 32 forks source link

Ionic4, Cordova 9 #32

Open webbkvalite opened 5 years ago

webbkvalite commented 5 years ago

Expected Behaviour

To work with Ionic4 and Cordova 9. Any plans / timeline on this? (Good job with the playlist function though! Are you the only one who have done this for Cordova? I can't find any other code...)

Actual Behaviour

Not compiling

codinronan commented 4 years ago

I didn't find this anywhere else either so I built it :)

I have updated the code to work with cordova 9 - unfortunately I don't use Ionic 4 so I am not sure what changes are needed to support it. A PR would be most welcome but in the meantime do you want to try cordova 9?

paulovargatt commented 4 years ago

Does this plugin work with HLS video streaming url for example?

schreyers commented 3 years ago

This plugin is awesome, but I think Ionic and the IOS version they build with edits the code as these are the warnings that you get:

[20:58:10]: ▸ Compiling RmxAudioPlayer.m [20:58:13]: ▸ ⚠️ /cordova-plugin-playlist/RmxAudioPlayer.m:124:9: block implicitly retains 'self'; explicitly mention 'self' to indicate this is intended behavior [-Wimplicit-retain-self] [20:58:13]: ▸ _isWaitingToStartPlayback = !startPaused; [20:58:13]: ▸ ~ ^~~~~ [20:58:13]: ▸ ⚠️ /cordova-plugin-playlist/RmxAudioPlayer.m:125:13: block implicitly retains 'self'; explicitly mention 'self' to indicate this is intended behavior [-Wimplicit-retain-self] [20:58:13]: ▸ if (_isWaitingToStartPlayback) { [20:58:13]: ▸ ^ [20:58:13]: ▸ ⚠️ /cordova-plugin-playlist/RmxAudioPlayer.m:130:13: block implicitly retains 'self'; explicitly mention 'self' to indicate this is intended behavior [-Wimplicit-retain-self] [20:58:13]: ▸ if (_isWaitingToStartPlayback) { [20:58:13]: ▸ ^ [20:58:13]: ▸ ⚠️ /cordova-plugin-playlist/RmxAudioPlayer.m:927:78: 'initWithImage:' is deprecated: first deprecated in iOS 10.0 - Use -initWithBoundsSize:requestHandler: [-Wdeprecated-declarations] [20:58:13]: ▸ return [self isCoverImageValid:coverImage] ? [[MPMediaItemArtwork alloc] initWithImage:coverImage] : nil;

I tried editing the ios RmxAudioPlayer.m file to have self->_isWaitingToStartPlayback but this didn't solve the issue

brakhmatov commented 3 years ago

I forked from this branch and made it work for ionic 5. I am still testing but it does compile and gets deployed to iPhone 8. I found another issue where going backwards after playlist is ended throws an exception, I had to modify the previous method to handle this scenario. Hope this helps someone.