File tree Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Original file line number Diff line number Diff line change @@ -885,6 +885,32 @@ <h3>
885
885
document.appendChild(spanElt);
886
886
};
887
887
</script>
888
+ </ pre >
889
+ </ section >
890
+ < section >
891
+ < h3 >
892
+ Creating a second presentation from the same controlling page
893
+ </ h3 >
894
+ < pre class ="example ">
895
+ <!-- controller.html -->
896
+ <!-- The same controlling page can create and manage multiple presentations,
897
+ by calling start() multiple times. -->
898
+ <button id="secondPresentBtn" style="display: none;">Present Again</button>
899
+ <script>
900
+ var secondPresentBtn = document.getElementById("secondPresentBtn");
901
+ var secondPresUrl = "https://example.com/second-presentation.html";
902
+ var secondRequest = new PresentationRequest(secondPresUrl);
903
+ // For simplicity, the logic to handle screen availability for secondRequest
904
+ // and update the status of secondPresentBtn is omitted.
905
+ secondPresentBtn.onclick = function () {
906
+ // Start new presentation, likely on a different screen than the original
907
+ // request.
908
+ secondRequest.start().then(setSecondConnection);
909
+ };
910
+ function setSecondConnection(newConnection) {
911
+ // Logic to handle messages to/from second-presentation.html.
912
+ };
913
+ </script>
888
914
</ pre >
889
915
</ section >
890
916
</ section >
You can’t perform that action at this time.
0 commit comments