MDN self-hosted library · e01.org

Presentation: receiver property

Runnable notebook: every JavaScript, HTML and CSS example on this page executes in a sandboxed local frame. Nothing leaves the browser.

js
footer.textContent = navigator.presentation.receiver
  ? "Receiving presentation"
  : "(idle)";
js
const listElem = document.getElementById("connection-view");

navigator.presentation.receiver.connectionList.then((connections) => {
  connections.forEach((connection) => {
    listElem.appendChild(document.createElement("li")).textContent =
      connection.id;
  });
});