0

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

user1165560
  • 331
  • 4
  • 21

2 Answers2

0

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.

Leon Nicholls
  • 4,623
  • 2
  • 16
  • 17
  • Thanks for your reply. I'll change to start the receiver earlier and monitor the performance. – user1165560 Mar 25 '16 at 18:35
  • Hi Leon, I changed to start the receiver early in our html. But still 10% of our users have timeout, can you suggest something else? Could it be we have a gif loading image and some 50k images? Or too many divs? – user1165560 Mar 28 '16 at 18:41
0

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

castReceiverManager.start({maxInactivity: 600});
flame3
  • 2,812
  • 1
  • 24
  • 32
  • Thanks. I'll try this and monitor. – user1165560 Mar 29 '16 at 17:44
  • Hi flame3, we tried your method. We still get the same amount of timeout errors. What could be the root of cause of this timeout? Receiver loading too much stuff and not responding? Poor network? or anything else? Thanks. – user1165560 Mar 31 '16 at 17:41
  • I have not got such problem before. I wonder if you have correct receiver code. Do you use direct iframe in your receiver? Maybe you can try to test loading time of your receiver page in a web browser with some monitoring tool and see if any parts need to be optimised. These are just my guess since I have not much experience in custom receiver. – flame3 Apr 01 '16 at 19:21
  • We use iframe in the receiver. We'll try to test loading time. – user1165560 Apr 29 '16 at 19:00