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

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

From: Shih-Chiang Chien via GitHub <sysbot+gh@w3.org>
Date: Mon, 08 Jun 2015 03:12:28 +0000
To: public-secondscreen@w3.org
Message-ID: <issue_comment.created-109848354-1433733146-sysbot+gh@w3.org>
Web developers can still use `bind` to reuse the same handling 
function, so it doesn't gain much benefit if we don't provide the URL 
after redirection.

For example,
```
navigator.presentation.startSession(firstUrl).then(handleSession.bind(null,
 firstUrl))
navigator.presentation.startSession(secondUrl).then(handleSession.bind(null,
 secondUrl))

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

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

-- 
GitHub Notif of comment by schien
See 
https://github.com/w3c/presentation-api/issues/102#issuecomment-109848354
Received on Monday, 8 June 2015 03:12:30 UTC

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