shi11 / RemoteControls

cordova 3 plugin for interacting with ios7 remote controls and metadata
57 stars 41 forks source link

When device is offline and no cover image available it only shows the audio full path #11

Open cazforeman opened 9 years ago

cazforeman commented 9 years ago

If an iOS device is offline (audio is saved locally to Library\no_cloud directory) - there is no thumbnail (cover image) - the remotecontrols show the file full path and not the value sent in setting 'title'. This looks very confusing for the user. When the device is online and so cover image is valid url then it works perfectly ..... great plugin btw !!!

Even if I send an empty string for the cover image or download the thumbnail to the same directory as the audio mp3 (which I realise may not help due to it being inaccessible outside the app code ????) - it still shows full file path and not the sent title value. Looking at code for RemoteControls.m file - if a valid image does not exist it uses a @'no-image' variable - not sure what this is - but it does seem that where no valid (accessible) image url is available then it does not work as expected and use the 'title' value.

I have tried downloading the thumbnail cover image to the Documents directory rather than Library\no-cloud ... but it still fails when offline and shows the fullpath. The files are not named according to the title and so make little sense to a user viewing this. However, the next/previous and play/pause events still work perfectly - its just the display of title ..... not really bothered about displaying an image when offline (as works when online) - its just the title.

Any help would be really appreciated !

pvandrunen commented 9 years ago

I can second this. It took me a LONG time to discover that if I do not have a valid image none of the other meta data will load. Passing an empty string would be ideal. The iOS api says that each of the meta data values are optional, the image should be as well. I would love to take a stab at it but I'm completely inept with objective C.

Second, I would love an example of how I can serve a local image for the album art — I've only figured out how to do this with a file from a server.

Thanks.

shi11 commented 9 years ago

Ok thanks. If there's an immediate need, please fork the repo and try offering a fix. It'll really help!