Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -885,6 +885,32 @@ <h3>
document.appendChild(spanElt);
};
&lt;/script&gt;
</pre>
</section>
<section>
<h3>
Creating a second presentation from the same controlling page
</h3>
<pre class="example">
&lt;!-- controller.html --&gt;
&lt;!-- The same controlling page can create and manage multiple presentations,
by calling start() multiple times. --&gt;
&lt;button id="secondPresentBtn" style="display: none;"&gt;Present Again&lt;/button&gt;
&lt;script&gt;
var secondPresentBtn = document.getElementById("secondPresentBtn");
var secondPresUrl = "https://example.com/second-presentation.html";
var secondRequest = new PresentationRequest(secondPresUrl);
// For simplicity, the logic to handle screen availability for secondRequest
// and update the status of secondPresentBtn is omitted.
secondPresentBtn.onclick = function () {
// Start new presentation, likely on a different screen than the original
// request.
secondRequest.start().then(setSecondConnection);
};
function setSecondConnection(newConnection) {
// Logic to handle messages to/from second-presentation.html.
};
&lt;/script&gt;
</pre>
</section>
</section>
Expand Down