mirror of
https://github.com/yattee/yattee.git
synced 2024-12-13 13:50:32 +05:30
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() {
|
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] = [
|
var nowPlayingInfo: [String: AnyObject] = [
|
||||||
MPMediaItemPropertyTitle: currentItem.video.title as AnyObject,
|
MPMediaItemPropertyTitle: currentItem.video.title as AnyObject,
|
||||||
MPMediaItemPropertyArtist: currentItem.video.author as AnyObject,
|
MPMediaItemPropertyArtist: currentItem.video.author as AnyObject,
|
||||||
|
Loading…
Reference in New Issue
Block a user