parent
fb1bac83ae
commit
3c32c68b5f
|
@ -300,11 +300,11 @@ final class ContentPlayerPlayManager: NSObject, ObservableObject {
|
|||
|
||||
if let player = player {
|
||||
// 콘텐츠 총 길이
|
||||
nowPlayingInfo[MPMediaItemPropertyPlaybackDuration] = player.currentItem?.duration ?? .zero
|
||||
nowPlayingInfo[MPMediaItemPropertyPlaybackDuration] = player.currentItem?.asset.duration.seconds ?? .zero
|
||||
// 콘텐츠 재생 시간에 따른 progressBar 초기화
|
||||
nowPlayingInfo[MPNowPlayingInfoPropertyPlaybackRate] = player.rate
|
||||
// 콘텐츠 현재 재생시간
|
||||
nowPlayingInfo[MPNowPlayingInfoPropertyElapsedPlaybackTime] = player.currentTime
|
||||
nowPlayingInfo[MPNowPlayingInfoPropertyElapsedPlaybackTime] = player.currentTime().seconds
|
||||
}
|
||||
|
||||
center.nowPlayingInfo = nowPlayingInfo
|
||||
|
@ -325,14 +325,14 @@ final class ContentPlayerPlayManager: NSObject, ObservableObject {
|
|||
return .success
|
||||
}
|
||||
|
||||
center.skipForwardCommand.isEnabled = true
|
||||
center.skipForwardCommand.addTarget { [unowned self] (commandEvent) -> MPRemoteCommandHandlerStatus in
|
||||
center.seekForwardCommand.isEnabled = true
|
||||
center.seekForwardCommand.addTarget { [unowned self] (commandEvent) -> MPRemoteCommandHandlerStatus in
|
||||
self.playNextContent()
|
||||
return .success
|
||||
}
|
||||
|
||||
center.skipBackwardCommand.isEnabled = true
|
||||
center.skipBackwardCommand.addTarget { [unowned self] (commandEvent) -> MPRemoteCommandHandlerStatus in
|
||||
center.seekBackwardCommand.isEnabled = true
|
||||
center.seekBackwardCommand.addTarget { [unowned self] (commandEvent) -> MPRemoteCommandHandlerStatus in
|
||||
self.playPreviousContent()
|
||||
return .success
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue