You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is forked from #35, to specifically request a feature whereby a lastsessionclosed event would be fired on navigator.presentation when the last session connected to the presentation was closed. The default behavior for this event would be to close the presentation document (similar to window.close()). The presentation could prevent this behavior by calling .preventDefault() on the event.
The default behavior of calling .close() when there is only one controller attached to the TV is unchanged. Calling .close() in that scenario will close the application.
The default behavior when multiple parties are connected is that the application is closed when the last controller calls .close()
The application on the TV gets to make the ultimate decision about when the application is closed. (Unless the user overrides by closing the application through other means of course.)
The PresentationSession API continues to match WebSocket and RTCDataChannel, i.e. we still have just .send()/onmessage/.close() and with those functions behaving the same across all three interfaces.
So I think that what we should optimize for here is developer ergonomics and reducing the risk of bugs.
The arguments against:
Another common case is that the presentation should continue running when the controller is disconnected, i.e. I begin playing a movie using my laptop and then close the laptop.
We don't want accidental disconnections of controllers (i.e., network disruption) to stop a running presentation.
In a multiplayer game, the presentation may want to continue running to allow new players to join.
This is just syntactic sugar for listening to onsessionconnect and keeping track of the number of connected sessions, then calling window.close() when the count drops to zero.
The text was updated successfully, but these errors were encountered:
I was mostly concerned about the scenario when a single controller has been connected, and that controller calls .close() to close the connection to the presentation. If we in that case wanted the presentation to automatically close, then we needed a default event to hang that closing action on.
But since we have .terminate(), and since @mfoltzgoogle in #35 indicated that other platforms don't close by default, then I think leaving the presentation open even if all controllers have .close()ed sounds fine.
And so in that case lastsessionclosed would just be a convenience feature which the page can easily live without by simply tracking closed sessions itself.
So I think we should just close this issue with no action.
@mfoltzgoogle This was tagged for F2F discussion. If you feel this issue would benefit from F2F discussion keep this open. Otherwise, feel free to close and remove the F2F tag.
It seems that we are satisfied that this does not require further action. I'm assuming that the resolution of #201 leads to a solution that allows the close-on-disconnect behavior to be implemented by the presentation author if they desire.
This is forked from #35, to specifically request a feature whereby a
lastsessionclosed
event would be fired onnavigator.presentation
when the last session connected to the presentation was closed. The default behavior for this event would be to close the presentation document (similar towindow.close()
). The presentation could prevent this behavior by calling.preventDefault()
on the event.This proposal was outlined in #35 (comment).
The arguments for this feature:
The arguments against:
onsessionconnect
and keeping track of the number of connected sessions, then callingwindow.close()
when the count drops to zero.The text was updated successfully, but these errors were encountered: