diff --git a/index.html b/index.html index ec56f9f..0986b8a 100644 --- a/index.html +++ b/index.html @@ -667,8 +667,22 @@
+ This code renders a button that is visible when there is at least one
+ compatible presentation display that can
+ present https://example.com/presentation.html
or
+ https://example.net/alternate.html
.
+
+ Monitoring of display availability is done by first creating + a PresentationRequest with the URLs you want to present, then + calling getAvailability to + obtain a PresentationAvailability object whose change + event will fire when presentation availability changes state. +
<!-- controller.html --> <button id="presentBtn" style="display: none;">Present</button> @@ -703,8 +717,23 @@
+ When the user clicks presentBtn
, this code requests
+ presentation of one of the URLs in the PresentationRequest.
+ When start is called, the
+ browser typically shows a dialog that allows the user to select one of
+ the compatible displays that are available. The first URL in
+ the PresentationRequest that is compatible with the chosen
+ display will be presented on that display.
+
+ The start method resolves + with a PresentationConnection object that is used to track the + state of the presentation, and exchange messages with the presentation + page once it's loaded on the display. +
<!-- controller.html --> <script> @@ -722,8 +751,17 @@
+ The presentation continues to run even after the original page that + started the presentation closes its PresentationConnection, + navigates, or is closed. Another page can use + the id on + the PresentationConnection to reconnect to an existing + presentation and resume control of it. This is only guaranteed to + work from the same browser that started the presentation. +
<!-- controller.html --> <button id="reconnectBtn" style="display: none;">Reconnect</button> @@ -750,8 +788,19 @@
+ Some browsers have a way for users to start a presentation without
+ interacting directly with the controlling page. Controlling pages can
+ opt into this behavior by setting
+ the defaultRequest property
+ on navigator.presentation
, and listening for
+ a connectionavailable event that is fired when a presentation
+ is started this way. The PresentationConnection passed with
+ the event behaves the same as if the page had
+ called start.
+
<!-- controller.html --> <!-- Setting presentation.defaultRequest allows the page to specify the @@ -768,8 +817,22 @@
+ Once a presentation has started, the + returned PresentationConnection is used to monitor its state + and exchange messages with it. Typically the user will be given the + choice to disconnect from or terminate the presentation from the + controlling page. +
++ Since the the controlling page may connect to and disconnect from multiple + presentations during its lifetime, it's helpful to keep track of the + current PresentationConnection and its state. Messages can + only be sent and received on connections in + a connected state. +
<!-- controller.html --> <button id="disconnectBtn" style="display: none;">Disconnect</button> @@ -843,8 +906,15 @@
+ This code runs on the presented page
+ (https://example.org/presentation.html
). Presentations
+ may be connected to from multiple controlling pages, so it's important
+ that the presented page listen for incoming connections on
+ the connectionList object.
+
<!-- presentation.html --> <script> @@ -895,6 +965,12 @@
Creating a second presentation from the same controlling page
++ It's possible for a controlling page to start and control two + independent presentations on two different presentation displays. + This code shows how a second presentation can be added to the first + one in the examples above. +
<!-- controller.html --> <!-- The same controlling page can create and manage multiple presentations, @@ -2163,7 +2239,8 @@context using S.
- When the terminate method is called on a + When the terminate + method is called on a PresentationConnection S in a receiving browsing context, the user agent MUST run the algorithm to terminate a presentation in a receiving browsing context @@ -2410,7 +2487,7 @@
message
, which does not bubble, is not cancelable, and has
no default action.
close
,
that uses the PresentationConnectionCloseEvent
interface, with the reason attribute
@@ -2681,8 +2758,7 @@ terminate
at known
connection.
terminate
at
connection.
onmessage
message
+ message
onclose
close
+ close
onterminate
terminate
+ terminate