mirror of
https://github.com/cranci1/Sora.git
synced 2026-03-28 21:38:44 +00:00
title also now?
This commit is contained in:
parent
f845ce3d7f
commit
f1ae2b27d4
1 changed files with 7 additions and 5 deletions
|
|
@ -100,15 +100,17 @@ class VideoPlayerViewController: UIViewController {
|
|||
let nowPlayingInfoCenter = MPNowPlayingInfoCenter.default()
|
||||
var nowPlayingInfo = [String: Any]()
|
||||
|
||||
nowPlayingInfo[MPMediaItemPropertyTitle] = "Episode \(episodeNumber)"
|
||||
nowPlayingInfo[MPMediaItemPropertyArtist] = mediaTitle
|
||||
nowPlayingInfo[MPMediaItemPropertyTitle] = mediaTitle
|
||||
nowPlayingInfo[MPMediaItemPropertyAlbumTitle] = "Episode \(episodeNumber)"
|
||||
|
||||
if let imageUrl = URL(string: episodeImageUrl) {
|
||||
URLSession.shared.dataTask(with: imageUrl) { [weak self] data, _, _ in
|
||||
guard let data = data, let image = UIImage(data: data) else { return }
|
||||
let artwork = MPMediaItemArtwork(boundsSize: image.size) { _ in image }
|
||||
nowPlayingInfo[MPMediaItemPropertyArtwork] = artwork
|
||||
MPNowPlayingInfoCenter.default().nowPlayingInfo = nowPlayingInfo
|
||||
DispatchQueue.main.async {
|
||||
let artwork = MPMediaItemArtwork(boundsSize: image.size) { _ in image }
|
||||
nowPlayingInfo[MPMediaItemPropertyArtwork] = artwork
|
||||
MPNowPlayingInfoCenter.default().nowPlayingInfo = nowPlayingInfo
|
||||
}
|
||||
}.resume()
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue