Skip to content

MEDIA ​

Implementation: supported · Proposal: in-review (status checked 2026-10-31). Session creation and playback binding have focused regression coverage; proposed torrent playback amendments are not implied. All capabilities remain subject to change. Maturity and opt-in policy.

Ownership-aware media sessions and playback control.

ts
const { sessionId } = await window.napplet.media.createSession({
  owner: 'napplet',
  metadata: { title: 'My Song', artist: 'The Artist' },
});
window.napplet.media.reportState(sessionId, { status: 'playing', position: 0, duration: 240 });
window.napplet.media.onCommand(sessionId, (action) => { if (action === 'pause') player.pause(); });

This non-normative guide defers to the living NAP-MEDIA proposal. Feature-gate with if (window.napplet?.media) before use; the runtime injects only available domains. Typed helpers ship from @napplet/nap/media and @napplet/sdk.

Released under the MIT License.