Closed parshap closed 9 years ago
I've realized this causes the promise given to attach()
to never get resolved because now in this case updateStatus(cb)
will never call the callback. I've made another change so that the callback is always called.
It still seems that the player object goes in an invalid state when an empty status is received asthis.currentSession
becomes undefined
, so any API calls via sessionRequest
throw an error when accessing session.mediaSessionId
.
Thanks, merged :)
I'll try if I'm able to reproduce the currentSession undefined problem. I think the main problem is that the module dosn't handle disconnects 100% correctly.
I came across an issue where Chromecast responds to a
GET_STATUS
request with an empty status:I'm not sure when exactly this can happen, but for me it happened after casting songza.com and then closing the tab (which causes the Chromecast to stop playing, but the receiver app is still running).
This change guards against this case by checking for the existence of a non-falsey status object.