feat(ios): add live key to now playing dict to decorate when livestream playing (#3922)
Co-authored-by: Paul <paul@dnconsulting.dev>
This commit is contained in:
parent
c1c7a056f1
commit
91751abc87
@ -226,6 +226,12 @@ class NowPlayingInfoCenterManager {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if CMTIME_IS_INDEFINITE(currentItem.asset.duration) {
|
||||||
|
nowPlayingInfo[MPNowPlayingInfoPropertyIsLiveStream] = true
|
||||||
|
} else {
|
||||||
|
nowPlayingInfo[MPNowPlayingInfoPropertyIsLiveStream] = false
|
||||||
|
}
|
||||||
|
|
||||||
nowPlayingInfo[MPMediaItemPropertyPlaybackDuration] = currentItem.duration.seconds
|
nowPlayingInfo[MPMediaItemPropertyPlaybackDuration] = currentItem.duration.seconds
|
||||||
nowPlayingInfo[MPNowPlayingInfoPropertyElapsedPlaybackTime] = currentItem.currentTime().seconds
|
nowPlayingInfo[MPNowPlayingInfoPropertyElapsedPlaybackTime] = currentItem.currentTime().seconds
|
||||||
nowPlayingInfo[MPNowPlayingInfoPropertyPlaybackRate] = player.rate
|
nowPlayingInfo[MPNowPlayingInfoPropertyPlaybackRate] = player.rate
|
||||||
@ -245,6 +251,11 @@ class NowPlayingInfoCenterManager {
|
|||||||
nowPlayingInfo[MPNowPlayingInfoPropertyElapsedPlaybackTime] = currentItem.currentTime().seconds.rounded()
|
nowPlayingInfo[MPNowPlayingInfoPropertyElapsedPlaybackTime] = currentItem.currentTime().seconds.rounded()
|
||||||
nowPlayingInfo[MPNowPlayingInfoPropertyPlaybackRate] = player.rate
|
nowPlayingInfo[MPNowPlayingInfoPropertyPlaybackRate] = player.rate
|
||||||
|
|
||||||
|
if CMTIME_IS_INDEFINITE(currentItem.asset.duration) {
|
||||||
|
nowPlayingInfo[MPNowPlayingInfoPropertyIsLiveStream] = true
|
||||||
|
} else {
|
||||||
|
nowPlayingInfo[MPNowPlayingInfoPropertyIsLiveStream] = false
|
||||||
|
}
|
||||||
MPNowPlayingInfoCenter.default().nowPlayingInfo = nowPlayingInfo
|
MPNowPlayingInfoCenter.default().nowPlayingInfo = nowPlayingInfo
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user