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

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
See 
https://github.com/w3c/presentation-api/issues/35#issuecomment-129735495

Received on Tuesday, 11 August 2015 07:07:29 UTC