Chromecast receiver timeout in Android

370 Views Asked by At

I'm using castcompanionlibrary on android to cast videos to a chromecast receiver. I use youtube iframe on the receiver side.

I used to call cast.receiver.CastReceiverManager.getInstance.start() in the html header before initializing youtube iframe and body and somehow I got 10% of the users having 2005 error which is "APPLICATION_NOT_RUNNING".

I then change to call cast.receiver.CastReceiverManager.getInstance.start() after header and body and youtube iframe, then I got 10% of the users having 15 which is "TIMEOUT" error.

I want to ask why and how the client got the TIMEOUT error. Is it because receiver is too slow to start since I start it after body and other js files are loaded? Or could it be the body has too many images and divs which takes time to load?

Thanks

2

There are 2 best solutions below

2
Leon Nicholls On

It is very important that you start the Cast receiver manager as early as possible in the receiver. Do not wait for window.onload for starting the manager. You might also want to consider lazy loading any other parts of the page that might initially be heavy lifting for the browser on chromecast.

4
flame3 On

You can try to increase the timeout like this. This maxInactivity 600 is 600 seconds. You can test other numbers.

castReceiverManager.start({maxInactivity: 600});