I'm developing an iOS app and have it Casting video to my Chromecast. I'm using the latest Cast SDK, the Default Receiver app, the stock Cast Button and Device Selection Dialog, etc.
I can successfully cast an HLS VOD playlist to the Chromecast and it plays fine. When I try to cast an HLS Livestream playlist, I get a disconnect after 3-5 minutes of play.
What happens is that my GCKSessionManagerListener
receives the call sessionManager(_ sessionManager: GCKSessionManager, didSuspend session: GCKSession, with reason: GCKConnectionSuspendReason)
with a suspend reason of -1 which...is not even in the enum?
I also get this in the log in Xcode, although I can't tell if it's an effect or a precipitation:
2018-04-10 09:43:58.414377-0700 iOS[4968:4491455] [] <<<< AVOutputDeviceDiscoverySession (FigRouteDiscoverer) >>>> -[AVFigRouteDiscovererOutputDeviceDiscoverySessionImpl outputDeviceDiscoverySessionDidChangeDiscoveryMode:]: Setting device discovery mode to DiscoveryMode_None (client: iOS)
This is not caused by my iPhone app going to background, as most "disconnection problems" seem to be; in fact, it can go to background just fine because I configured the context options with suspendSessionsWhenBackgrounded = false
. It just dies after about 4 minutes.
If I switch to a stock Receiver app and debug it via chrome://inspect
, I saw only one error near the start of playing (something about an Item ID not supposed to be set) and then about 4 minutes later I get Debugging connection closed. Reason: Connection was lost.
How can I debug this or get more information about why my session is disconnecting?