arielfaur / ionic-audio

An audio player for Ionic 3 and Angular 4. Works with HTML 5 audio or native audio using Cordova Media plugin.
http://arielfaur.github.io/ionic-audio/2.0/index.html
MIT License
321 stars 163 forks source link

Track art on lock screen #119

Open andrewlongdotcom opened 7 years ago

andrewlongdotcom commented 7 years ago

I am able to use ionic-audio to play my tracks and they continue to play in the background when i leave the app or lock the phone (iphone 6/ios 10.3.1). when i load my track i am setting the art property to a valid http url. the image shows up on my play page in the app, but i expect it to also be displayed from the lock screen as well as other track meta data (i.e. track and artist). but all i see is the generic music image and the track url. this.singleTrack = { src: this.selectedFeedItem.link, artist: this.selectedFeed.title, title: this.selectedFeedItem.title, art: (this.selectedChannelFeed.imageUrl === null) ? 'assets/HeaderLogo.png' : this.selectedChannelFeed.imageUrl, preload: 'metadata' };

is there something else i need to be doing to get the image/artist/title to be shown on the lock screen?

tbergeron commented 7 years ago

Are you testing this via Ionic View or by deploying directly on the device? Just curious as I'm not getting the playback in the background working right now using Ionic View on iOS.

I'll take a look at this soon, I'll update this issue if I find anything worthwhile.

andrewlongdotcom commented 7 years ago

I am deploying the app to my device. I am almost positive that ionic view will not support background audio on ios.

tbergeron commented 7 years ago

I thought the same about background audio & ionic view. Just wanted to know, thanks for the info!

arielfaur commented 7 years ago

@andrewlongdotcom @tbergeron Sorry I have been absent lately. I don't have time to look at ionic-audio issues lately, too busy on other -paid- projects 😸 I have no clue how you can get the metadata to appear on the lock screen. I assume a different plugin is needed, or something like that. If any of you find a way let me know!

davidkirolos commented 7 years ago

You will nee Music Controls plugin to run along with ionic-audio, I think It would be nice if we can add the code to manage Music Controls to ionic-audio component.

Please check Music Controls Plugin here

Notice Music controls doesn't work correctly with background mode enabled, but using it will keep your audio file playing even in the background.

outoftheboxbz commented 6 years ago

Its works well on my end. This plugin with ionic music controls and background mode. Also my art shows in the lockscreen but only remote images. Local images not working. Was wondering if there is a way to implement autoplay? Anybody has any luck with autoplay?