잠금화면 플레이어
- 재생시간 표시 및 이전/다음 버튼 변경
This commit is contained in:
		| @@ -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 | ||||
|         } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Yu Sung
					Yu Sung