<sessions-embed>
A Spotify, Apple Music or YouTube player in a sandboxed frame.
<Embed>GroupActionsDrawn asiframePreview
Drawn by the same renderers Sessions uses for your extension, from the DOM example beside it, without its event handlers.
When to use it
Frames a player — a playlist, a video — sandboxed, with autoplay and encrypted media allowed. Only these origins are framed: https://open.spotify.com, https://embed.music.apple.com, https://www.youtube.com and https://www.youtube-nocookie.com. Any other URL or scheme renders nothing (and logs a warning in development), because the frame sits inside a staff or signed-in buyer page. It grows open and fades in when src is set and collapses when src is removed, so keep the element mounted and change src.
In Preact and React, import the component of the same name from @sessions/apps/preact or @sessions/apps/react. Attributes become camelCase props, a boolean attribute is a boolean prop, and an event is an on prop that receives the event’s detail.
Attributes
srcsrcheight320.Prop heighttitletitleimport {Embed} from '@sessions/apps/preact';
<Embed
src={id ? `https://open.spotify.com/embed/playlist/${id}` : undefined}
height="480"
title="Spotify"
/>In the same group
<sessions-button>A button, or a link styled as one when to is set.<sessions-banner>A callout with a heading and a body.<sessions-badge>A small status label.<sessions-image>An image with an accessible description.<sessions-disclosure-group>Stacks sessions-disclosure rows with dividers between them.<sessions-disclosure>A row that expands to reveal its children.