Presentation and Receiver
The Presentation and Receiver components enable you to display web content on secondary screens (external displays, TVs, projectors, or wireless displays) using the Presentation API. The Presentation controller manages the connection from the primary device, while the Receiver controller handles incoming connections on the secondary display. Together, they enable multi-screen experiences for presentations, digital signage, gaming, and collaborative applications.
This component pair is particularly useful for:
Delivering presentations on external displays or projectors
Creating second-screen experiences for entertainment applications
Building digital signage solutions
Implementing collaborative whiteboarding and meeting tools
Developing multi-display gaming experiences
Showing media content on TVs via Chromecast or similar devices
Creating kiosk applications with separate control and display screens
Building remote display and monitoring dashboards
Browser Support
The Presentation API has limited but growing support, primarily in Chromium-based browsers.
Support level: Limited - Supported in Chrome and Edge on desktop and Android. Requires compatible hardware (Chromecast, wireless displays, or other secondary screens). Not supported in Safari or Firefox as of early 2025.
The Presentation API requires compatible hardware to function. Users need access to:
Chromecast devices
Miracast-compatible displays
Smart TVs with casting capabilities
Or physical secondary displays connected to the device
Always check for presentation availability before offering this functionality to users. The Presentation controller emits an availability-changed event you can use to show/hide presentation controls.
Architecture
The Presentation API works with two parts:
Presentation Controller (Primary Device): Runs on the user's main device (phone, laptop). Initiates and controls the presentation.
Receiver (Secondary Display): Runs on the secondary screen. Receives and displays content.
Communication flows bidirectionally between controller and receiver through message passing.
Usage
Presentation Controller (Primary Device)
The presentation controller runs on the device that initiates the presentation.
Basic Presentation Setup
Sending Messages to Receiver
Reconnecting to Existing Presentation
Receiver (Secondary Display)
The receiver runs on the secondary display and handles incoming messages.
Basic Receiver Setup
Two-Way Communication
Best Practices
Check Availability First
Always check for presentation display availability before showing presentation controls. This prevents showing features that won't work for the user.
Handle Reconnection Gracefully
Connection IDs are persisted in localStorage. Implement reconnection logic to allow users to resume presentations after page refreshes.
Design for Large Screens
The receiver typically runs on large displays (TVs, projectors). Design your receiver UI with larger fonts, higher contrast, and appropriate scaling for viewing from a distance.
Keep Controller and Receiver in Sync
Ensure your controller and receiver stay synchronized. Include state synchronization logic when connections are established or reconnected.
Error Handling
Common Use Cases
1. Slide Presentation System
2. Digital Signage
3. Multi-Display Gaming
4. Collaborative Whiteboard
API Reference
Presentation Controller
Values
urls
Type: Array Required: Yes
Array of URLs that can be presented on the secondary display. Typically contains a single URL pointing to your receiver page.
Actions
start()
Initiates a new presentation. Opens a browser dialog for the user to select a display.
Returns: Promise<void>
reconnect()
Attempts to reconnect to an existing presentation using the stored connection ID from localStorage.
Returns: Promise<void>
send(params)
Sends a message to the receiver.
Parameters:
params.params(object): Data to send (will be JSON stringified)
terminate()
Closes the presentation connection.
Events
availability-changed
Fired when presentation display availability changes or on initial connection.
Event detail:
availability.value(boolean): Whether presentation displays are available
started
Fired when a presentation connection is successfully established.
Event detail:
id(string): Connection ID
terminated
Fired when the presentation connection is closed.
Event detail:
id(string): Connection ID that was terminated
Receiver
Values
None
Actions
None (receiver is passive - it only listens for events)
Events
message
Fired when a message is received from the controller.
Event detail:
data(object): Parsed JSON data from controller
close
Fired when the connection is closed.
Event detail:
connectionId(string): Connection IDreason(string): Close reasonmessage(string): Close message
Related Components
Service Worker - May be used for offline receiver pages
Fullscreen - Often used together for immersive presentation experiences
Wake Lock - Keep screen on during presentations
Resources
Last updated
Was this helpful?