now playing centre

This commit is contained in:
Stephen Byatt 2021-06-25 16:27:10 +10:00
parent 370cc000b2
commit d69fee7056
1 changed files with 2 additions and 7 deletions

View File

@ -341,9 +341,7 @@ class PlayerViewController: UIViewController, GCKDiscoveryManagerListener, GCKRe
}
}
var nowPlayingInfo = [String: Any]()
nowPlayingInfo[MPMediaItemPropertyTitle] = manifest.name ?? ""
var nowPlayingInfo = [String : Any]()
var runTicks = 0
var playbackTicks = 0
@ -356,9 +354,6 @@ class PlayerViewController: UIViewController, GCKDiscoveryManagerListener, GCKRe
playbackTicks = Int(ticks / 10_000_000)
}
MPNowPlayingInfoCenter.default().nowPlayingInfo = nowPlayingInfo
nowPlayingInfo[MPMediaItemPropertyTitle] = manifest.name ?? "Jellyfin Video"
nowPlayingInfo[MPNowPlayingInfoPropertyPlaybackRate] = 1.0
nowPlayingInfo[MPNowPlayingInfoPropertyMediaType] = AVMediaType.video
@ -374,7 +369,7 @@ class PlayerViewController: UIViewController, GCKDiscoveryManagerListener, GCKRe
}
}
print("set up now playing center")
MPNowPlayingInfoCenter.default().nowPlayingInfo = nowPlayingInfo
UIApplication.shared.beginReceivingRemoteControlEvents()
}