mirror of
https://github.com/yattee/yattee.git
synced 2024-12-22 13:33:42 +00:00
Fix updating player item duration for live streams
This commit is contained in:
parent
c4ca5eb4c7
commit
d7058b46d3
@ -502,7 +502,11 @@ final class PlayerModel: ObservableObject {
|
||||
}
|
||||
|
||||
fileprivate func updateNowPlayingInfo() {
|
||||
let duration: Int? = currentItem.video.live ? nil : Int(currentItem.videoDuration ?? 0)
|
||||
var duration: Int?
|
||||
if !currentItem.video.live {
|
||||
let itemDuration = currentItem.videoDuration ?? 0
|
||||
duration = itemDuration.isFinite ? Int(itemDuration) : nil
|
||||
}
|
||||
var nowPlayingInfo: [String: AnyObject] = [
|
||||
MPMediaItemPropertyTitle: currentItem.video.title as AnyObject,
|
||||
MPMediaItemPropertyArtist: currentItem.video.author as AnyObject,
|
||||
|
Loading…
Reference in New Issue
Block a user