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

Re: [presentation-api] Fix bugs related to PresentationSession.url attribute

From: Mark Foltz via GitHub <sysbot+gh@w3.org>
Date: Sun, 07 Jun 2015 22:11:04 +0000
To: public-secondscreen@w3.org
Message-ID: <issue_comment.created-109806331-1433715062-sysbot+gh@w3.org>
@obeletski @schien I thought of a use case for this attribute.  If a 
single controlling page has requested to start or join multiple 
presentations (each with their own URL) then it could result in 
simpler code to include the URL in the PresentationSession.

e.g. instead of
```
navigator.presentation.startSession(firstURL).then(handleSessionForFirstURL)
navigator.presentation.startSession(secondURL).then(handleSessionForSecondURL)
```
it would be
```
navigator.presentation.startSession(firstUrl).then(handleSession)
navigator.presentation.startSession(secondUrl).then(handleSession)

handleSession = function(session) {
  // Code common to all presentation sessions goes here

  // Now code specific to the presentation content
  if (session.url == firstUrl) ...
  else if (session.url == secondUrl) ...
}
```

Any thoughts?

-- 
GitHub Notif of comment by mfoltzgoogle
See 
https://github.com/w3c/presentation-api/issues/102#issuecomment-109806331
Received on Sunday, 7 June 2015 22:11:07 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 17:18:56 UTC