我想在我的应用程序中显示播放歌曲的剩余时间,我的代码:
NSTimeInterval currentTime= musicPlayer.currentPlaybackTime;
NSNumber *duration = [musicPlayer.nowPlayingItem valueForProperty:MPMediaItemPropertyPlaybackDuration];
NSLog(@"Current Playback Time: %f",currentTime);
Run Code Online (Sandbox Code Playgroud)