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 { if !currentItem.video.live {
let itemDuration = currentItem.videoDuration ?? 0 let itemDuration = currentItem.videoDuration ?? currentItem.duration
let duration = itemDuration.isFinite ? Int(itemDuration) : nil let duration = itemDuration.isFinite ? Double(itemDuration) : nil
if !duration.isNil { if !duration.isNil {
nowPlayingInfo[MPMediaItemPropertyPlaybackDuration] = duration as AnyObject nowPlayingInfo[MPMediaItemPropertyPlaybackDuration] = duration as AnyObject