SuperAPI AI Directory

MDN Web Docs

Introduces the Presentation API, the simplest AI-driven API that can be used to add presentation generation capabilities to your application or website.

Open website

About this tool

Purpose

The Presentation API allows user agents (such as web browsers) to effectively display web content on large presentation devices such as projectors and network-connected televisions. Supported device types include displays connected by wired means such as HDMI and DVI, as well as devices connected wirelessly via DLNA, Chromecast, AirPlay, or Miracast.

Main capabilities

  • Web pages can use the Presentation Controller API to specify the web content to be rendered on a presentation device and to initiate a presentation session.
  • Using the Presentation Receiver API, the presentation-side web page can obtain session state.
  • A message-based channel is provided between the controller page and the receiver page, allowing developers to implement interaction between the two pages.
  • Depending on the connection mechanism provided by the presentation device, the controller page and the receiver page may be rendered by the same user agent or by different user agents.
    • In 1-UA mode devices, both pages are loaded by the same user agent, and the rendering result of the receiver page is sent to the presentation device through a supported remote rendering protocol.
    • In 2-UAs mode devices, the receiver page is loaded directly on the presentation device, and the controlling user agent communicates with the presentation device through a supported presentation control protocol to control the presentation session and pass messages between the two pages.
  • In the controlling browsing context, the Presentation interface provides a mechanism to override the browser's default behavior for launching an external screen presentation.
  • In the receiving browsing context, the Presentation interface provides access to available presentation connections.

Usage

This API involves the following main interfaces:

  • PresentationRequest: initiates or reconnects to a presentation created by a controlling browsing context.
  • PresentationAvailability: is associated with an available presentation display and indicates the availability of a presentation display for a given presentation request.
  • PresentationConnectionAvailableEvent: is fired on a PresentationRequest object when a connection associated with that object is created.
  • PresentationConnection: represents each presentation connection.
  • PresentationConnectionCloseEvent: is fired when a presentation connection enters the closed state.
  • PresentationReceiver: allows the receiving browsing context to access and communicate with the controlling browsing context.
  • PresentationConnectionList: represents the collection of non-terminated presentation connections and is also a monitor for newly available presentation connection events.

The MDN documentation provides example code, in which controller.html implements the controller and presentation.html implements the presentation side, with both pages loaded from https://example.org provided (https://example.org/controller.html and https://example.org/presentation.html)。示例假设控制页面一次管理一个演示。示例涵盖:监视演示显示器的可用性、启动新演示、重新连接到演示、通过设置 presentation.defaultRequest allows the controlling user agent to initiate a presentation, monitor connection status and exchange data, monitor available connections and send greetings, and pass area information through messages.

In addition, the Presentation API polyfill contains a JavaScript polyfill of the Presentation API specification being standardized by the W3C Second Screen Working Group, mainly used to explore how to implement the Presentation API on top of different presentation mechanisms.

Use cases

Suitable for web development scenarios that need to project content from a web page to large-screen devices such as projectors and network TVs and implement two-way communication between the controller and the receiver.

Limitations

  • This feature is not Baseline because it does not work in some of the most widely used browsers.
  • It is available only in secure contexts (HTTPS), and only in some or all supporting browsers.
  • It is an experimental technology, and the browser compatibility table should be carefully checked before use in production environments.

Other notes

This page was last modified on September 19, 2025, and is maintained by MDN contributors.