Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Leave receiver running after sender stop

Tags:

chromecast

I'm using a simple receiver based on the Google CastHelloText sample app. When the sender disconnects, I'd like to allow the receiver to continue display.

I thought this could be accomplished by modifying the receiver's onSenderDisconnect function to skip the window.close call but when I disconnect my sender by calling session.stop, the receiver is shutdown withou a call to onSenderDisconnect. I see a "Dispatching shutdown event" in the receiver log.

How can I get the receiver to continue without the sender connection?

like image 882
SeattleStephens Avatar asked Jun 21 '14 19:06

SeattleStephens


1 Answers

If you want to allow receiver to continue, do not call stop in your sender; that call sends a message to the receiver that would result in stoping the application on receiver; here is what the documentation for that method says: "Stops the running receiver application associated with the session.". On chrome senders, you can simply close the tab if you want to let the receiver continue . Note that the onSenderDisconnect now has an argument that shows whether disconnect was explicit (intentional) or not, in case you want to handle explicit disconnects differently. Other platforms, e.g. Android SDK, also have similar stopApplication methods that should not be called if you do not want to stop the running application on the receiver. On Android and iOS, you have more APIs to provide a more fine-tuned "disconnect" experience.

like image 79
Ali Naddaf Avatar answered Oct 02 '22 07:10

Ali Naddaf