Skip to content
This repository was archived by the owner on Jul 12, 2024. It is now read-only.
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions Classes/NetHoyohoyoTiremotecontrolModule.m
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,10 @@ -(void)setNowPlayingInfo:(id)args
NSString *albumTitle = [TiUtils stringValue:@"albumTitle" properties:args def:@""];
BOOL *albumArtworkLocal = [TiUtils boolValue:@"albumArtworkLocal" properties:args def:@""];
NSString *albumArtwork = [TiUtils stringValue:@"albumArtwork" properties:args def:nil];

NSString *duration = [TiUtils stringValue:@"duration" properties:args def:@""];
NSString *elapsed = [TiUtils stringValue:@"elapsed" properties:args def:@"0.0"];
NSString *rate = [TiUtils stringValue:@"rate" properties:args def:@"1.0"];

Class playingInfoCenter = NSClassFromString(@"MPNowPlayingInfoCenter");

if (playingInfoCenter) {
Expand Down Expand Up @@ -139,7 +142,10 @@ -(void)setNowPlayingInfo:(id)args
[songInfo setObject:artist forKey:MPMediaItemPropertyArtist];
[songInfo setObject:title forKey:MPMediaItemPropertyTitle];
[songInfo setObject:albumTitle forKey:MPMediaItemPropertyAlbumTitle];

[songInfo setObject:duration forKey:MPMediaItemPropertyPlaybackDuration];
[songInfo setObject:elapsed forKey:MPNowPlayingInfoPropertyElapsedPlaybackTime];
[songInfo setObject:rate forKey:MPNowPlayingInfoPropertyDefaultPlaybackRate];

[[MPNowPlayingInfoCenter defaultCenter] setNowPlayingInfo:songInfo];
}
}
Expand Down