Fix reporting player item duration to Now Playing

This commit is contained in:
Arkadiusz Fal 2021-12-29 20:20:09 +01:00
parent 89957e3b56
commit 149607efbc

View File

@ -670,8 +670,8 @@ final class PlayerModel: ObservableObject {
}
if !currentItem.video.live {
let itemDuration = currentItem.videoDuration ?? 0
let duration = itemDuration.isFinite ? Int(itemDuration) : nil
let itemDuration = currentItem.videoDuration ?? currentItem.duration
let duration = itemDuration.isFinite ? Double(itemDuration) : nil
if !duration.isNil {
nowPlayingInfo[MPMediaItemPropertyPlaybackDuration] = duration as AnyObject