Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit db4e4fe

Browse files
committed
no errors but not sure the cover is working yet
1 parent e8a746c commit db4e4fe

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

src/ios/RemoteControls.m

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,13 @@ - (void)updateMetas:(CDVInvokedUrlCommand*)command
2525
NSString *album = [command.arguments objectAtIndex:2];
2626
NSString *cover = [command.arguments objectAtIndex:3];
2727
NSString *elapsedTime = [command.arguments objectAtIndex:4];
28+
29+
NSString* basePath = [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) objectAtIndex:0];
30+
NSString *fullPath = [NSString stringWithFormat:@"%@%@", basePath, cover];
2831

2932
MPMediaItemArtwork *albumArt;
3033
if (NSClassFromString(@"MPNowPlayingInfoCenter")) {
31-
UIImage *image = [UIImage imageNamed:cover];
34+
UIImage *image = [UIImage imageNamed:fullPath];
3235
albumArt = [[MPMediaItemArtwork alloc] initWithImage:image];
3336

3437
MPNowPlayingInfoCenter *infoCenter = [MPNowPlayingInfoCenter defaultCenter];

0 commit comments

Comments
 (0)