W3C home > Mailing lists > Public > public-secondscreen@w3.org > August 2015

Re: [presentation-api] Refine how to do session teardown/disconnect/closing

From: Jonas Sicking via GitHub <sysbot+gh@w3.org>
Date: Tue, 11 Aug 2015 07:07:26 +0000
To: public-secondscreen@w3.org
Message-ID: <issue_comment.created-129735495-1439276844-sysbot+gh@w3.org>
I like the idea of "terminated". Though it doesn't really answer the 
question of when the page on the TV is closed, does it?

I was first thinking that we could make the statechange event when we 
transition to "terminated" be cancelable, and make the default 
behavior be to close the page on the TV. I.e. we'd close the page by 
default, but the page can override by calling .preventDefault().

However that's somewhat awkward for a couple of reasons.

First of all it's only when the *last* PresentationSession object is 
terminated that we would want to close the page.

Second, it's a bit weird to cancel a statechange event since no matter
 what, the state *does* change. It's the closing of the page as a 
result of it that may or may not happen.

So maybe we should fire a "lastsessionterminated" (please come up with
 a better name) event on the navigator.presentation object when the 
last session is terminated. The default action of this event would be 
to kill the page. If the event is cancelled the page stays open.

Either way, I think the page can at any time call window.close() to 
close the application on the TV.

GitHub Notif of comment by sicking
Received on Tuesday, 11 August 2015 07:07:29 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 11 August 2015 07:07:29 UTC