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

@avayvod All good points.  I am in favor of landing a smaller change 
now, and using feedback to add the additional features discussed in 
this thread.

In particular, it seems like the question of the default behavior for 
the presentation when all sessions are disconnected will be difficult 
to answer without additional real world experience.  I can say that 
for Google Cast applications, the default behavior is to leave the 
presentation running; it's suggested that the presentation close 
itself when the last sender disconnects [1], but many implement some 
timeout before doing that.

Here is a simplified version of the proposal in 
https://github.com/w3c/presentation-api/issues/35#issuecomment-138727080:

```
enum PresentationSessionState {
    "connected",
    "closed",
    "terminated" 
};

partial interface PresentationSession {
    readonly attribute PresentationSessionState state;

    // Both sides transition to "closed."  Presenting context remains
    // running.
    void close(); 

    // All connected sessions transition to "terminated."  Presenting
    // context is closed.
    void terminate();

    // Fired on change to .state
    attribute EventHandler onstatechange;
};
```

![presentation session state diagram v2 
1](https://cloud.githubusercontent.com/assets/1910312/9794760/cf62a9b2-57a1-11e5-93ac-e9235a5e0864.png)


[1] 
https://developers.google.com/cast/docs/custom_receiver#session-management

I plan to prepare a PR to implement this, 


-- 
GitHub Notif of comment by mfoltzgoogle
See 
https://github.com/w3c/presentation-api/issues/35#issuecomment-139308539

Received on Thursday, 10 September 2015 16:54:45 UTC