Closed paulrinaldi closed 3 months ago
From looking at released apps such as CNN, NBC, and Radio on the Apple App Store and what is available in the documentation, it seems the best we can do on iOS is get the control notification banner to say "LIVE" instead of just he weird -- on both sides. This patch is what I think is required and other suggest on the web (although from 2018):
However, after making this change on 6.2.0, I still see the same functionality what is above.
class NowPlayingInfoCenterManager {
static let shared = NowPlayingInfoCenterManager()
...
public func updateMetadata() {
...
nowPlayingInfo[MPNowPlayingInfoPropertyIsLiveStream] = true // todo: add if statement so we only do it on livestreams
}
}
I also was struggling to figure out the best way to determine when to set the nowPlayingInfo[MPNowPlayingInfoPropertyIsLiveStream] = true
since we should not set when the item being played is not a livestream.
Unfortunately, this can't be tested on a simulator since Apple doesn't show notifications on simulators so debugging what is going wrong is further complicated.
Looking for help/suggestions.
Goal (right side):
@paulrinaldi did you see: mpnowplayinginfopropertyplaybackprogress ? moreover the 'timings' are not peridicly refreshed, It also think it should be an issue ...
maybe you can also try to enable: https://developer.apple.com/documentation/mediaplayer/mpnowplayingsession/4076567-automaticallypublishesnowplaying just to see if time is coming
I don't think live is the good clue, even if it make sens to enable its usage
Playbackprogress doesn't look too helpful in this case. Unfortunately, apple notes that "If you create an MPNowPlayingSession object, don’t attempt to use it with the AVPlayer that an AVPlayerViewController presents." (source and so it is taking more effort in trying to even test this. Also MPNowPlayingSession is only available in iOS 16+ it seems.
Still, it is so weird that setting live doesn't work correctly. I may try the basic example.
I got live to work with that key being set in the example/basic, should be able to add a detection mechanism and then send a fix
Working on iOS in 6.3 now
Version
6.2.0
What platforms are you having the problem on?
iOS
System Version
15, 16, 17.5
On what device are you experiencing the issue?
Real device
Architecture
Old architecture
What happened?
When viewing notification controls on iOS with a live stream, the following do not display:
whereas on Android they do.
Observed on real devices (1 physical device on 17.5, 2 devices on Browserstack).
Reproduction
No response
Reproduction
Step to reproduce this bug are:
UIBackgroundModes: ["audio"]
in Expo)e.g.