diff --git a/ios/Video/NowPlayingInfoCenterManager.swift b/ios/Video/NowPlayingInfoCenterManager.swift index 674c249180..d61dacfaa8 100644 --- a/ios/Video/NowPlayingInfoCenterManager.swift +++ b/ios/Video/NowPlayingInfoCenterManager.swift @@ -226,6 +226,12 @@ class NowPlayingInfoCenterManager { }) } + if let urlAsset = currentItem.asset as? AVURLAsset, urlAsset.url.absoluteString.hasSuffix("m3u8") { + nowPlayingInfo[MPNowPlayingInfoPropertyIsLiveStream] = true + } else { + nowPlayingInfo[MPNowPlayingInfoPropertyIsLiveStream] = false + } + nowPlayingInfo[MPMediaItemPropertyPlaybackDuration] = currentItem.duration.seconds nowPlayingInfo[MPNowPlayingInfoPropertyElapsedPlaybackTime] = currentItem.currentTime().seconds nowPlayingInfo[MPNowPlayingInfoPropertyPlaybackRate] = player.rate @@ -245,6 +251,11 @@ class NowPlayingInfoCenterManager { nowPlayingInfo[MPNowPlayingInfoPropertyElapsedPlaybackTime] = currentItem.currentTime().seconds.rounded() nowPlayingInfo[MPNowPlayingInfoPropertyPlaybackRate] = player.rate + if let urlAsset = currentItem.asset as? AVURLAsset, urlAsset.url.absoluteString.hasSuffix("m3u8") { + nowPlayingInfo[MPNowPlayingInfoPropertyIsLiveStream] = true + } else { + nowPlayingInfo[MPNowPlayingInfoPropertyIsLiveStream] = false + } MPNowPlayingInfoCenter.default().nowPlayingInfo = nowPlayingInfo } }