|
@@ -148,12 +148,7 @@ class NCPlayerToolBar: UIView {
|
|
|
labelOverallDuration.text = "-" + NCUtility.shared.stringFromTime(durationTime)
|
|
|
}
|
|
|
|
|
|
-
|
|
|
- if CCUtility.fileProviderStorageExists(metadata.ocId, fileNameView: metadata.fileNameView) {
|
|
|
- endableCommandCenter()
|
|
|
- }
|
|
|
-
|
|
|
- updateToolBar(timeSeek: timeSeek)
|
|
|
+ updateToolBar(timeSeek: timeSeek, commandCenter: true)
|
|
|
|
|
|
self.timeObserver = appDelegate.player?.addPeriodicTimeObserver(forInterval: CMTimeMakeWithSeconds(1, preferredTimescale: 1), queue: .main, using: { (CMTime) in
|
|
|
|
|
@@ -165,12 +160,17 @@ class NCPlayerToolBar: UIView {
|
|
|
})
|
|
|
}
|
|
|
|
|
|
- public func updateToolBar(timeSeek: CMTime? = nil) {
|
|
|
+ public func updateToolBar(timeSeek: CMTime? = nil, commandCenter: Bool = false) {
|
|
|
guard let metadata = self.metadata else { return }
|
|
|
|
|
|
var currentTime = appDelegate.player?.currentTime() ?? .zero
|
|
|
currentTime = currentTime.convertScale(1000, method: .default)
|
|
|
|
|
|
+
|
|
|
+ if commandCenter && CCUtility.fileProviderStorageExists(metadata.ocId, fileNameView: metadata.fileNameView) {
|
|
|
+ enableCommandCenter()
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
if CCUtility.getAudioMute() {
|
|
|
muteButton.setImage(NCUtility.shared.loadImage(named: "audioOff", color: .white), for: .normal)
|
|
@@ -242,7 +242,7 @@ class NCPlayerToolBar: UIView {
|
|
|
|
|
|
|
|
|
|
|
|
- func endableCommandCenter() {
|
|
|
+ func enableCommandCenter() {
|
|
|
guard let ncplayer = self.ncplayer else { return }
|
|
|
|
|
|
UIApplication.shared.beginReceivingRemoteControlEvents()
|