ChapterInformation

Limited availability

This feature is not Baseline because it does not work in some of the most widely-used browsers.

Experimental: This is an experimental technology
Check the Browser compatibility table carefully before using this in production.

The ChapterInformation interface of the Media Session API represents the metadata for an individual chapter of a media resource (i.e., a video or audio file).

The chapter information for a given media resource is set when it is first created, via the chapterInfo property of the MediaMetadata() constructor's initialization object. The property takes an array of ChapterInformation objects as its value.

You can access the chapter information for an existing MediaMetadata object via its chapterInfo property. This returns an array of ChapterInformation objects.

Instance properties

ChapterInformation.artwork Read only

Returns an Array of objects representing images associated with the chapter.

ChapterInformation.startTime Read only

Returns a number, in seconds, representing the start time of the chapter.

ChapterInformation.title Read only

Returns a string representing the title of the chapter.

Examples

The sample code below from Video / Media Session Sample shows a typical structure for the ChapterInformation object:

js
const BASE_URL = "https://storage.googleapis.com/media-session/";

const metadata = {
  // …
  chapterInfo: [
    {
      title: "Chapter 1",
      startTime: 0,
      artwork: [
        {
          src: `${BASE_URL}sintel/chapter1-128.png`,
          sizes: "128x128",
          type: "image/png",
        },
        {
          src: `${BASE_URL}sintel/chapter1-512.png`,
          sizes: "512x512",
          type: "image/png",
        },
      ],
    },
    {
      title: "Chapter 2",
      startTime: 37,
      artwork: [
        {
          src: `${BASE_URL}sintel/chapter2-128.png`,
          sizes: "128x128",
          type: "image/png",
        },
        {
          src: `${BASE_URL}sintel/chapter2-512.png`,
          sizes: "512x512",
          type: "image/png",
        },
      ],
    },
  ],
};

The following snippet shows how it can be used inside Media Session code (the above object property is part of the playlist object referenced below):

js
function updateMetadata() {
  const track = playlist[index];

  log(`Playing ${track.title} track...`);
  navigator.mediaSession.metadata = new MediaMetadata({
    title: track.title,
    artist: track.artist,
    artwork: track.artwork,
    chapterInfo: track.chapterInfo,
  });

  // …
}

Specifications

Specification
Media Session
# chapterinformation

Browser compatibility

desktop mobile
Chrome
Edge
Firefox
Opera
Safari
Chrome Android
Firefox for Android
Opera Android
Safari on iOS
Samsung Internet
WebView Android
WebView on iOS
ChapterInformation
Experimental
Chrome – Full support
Chrome 127 (Release date: 2024-07-23)
footnote Full support
Edge – Full support
Edge 127 (Release date: 2024-07-25)
footnote Full support
Firefox – No support
Firefox
footnote No support
Opera – Full support
Opera 113 (Release date: 2024-08-22)
footnote Full support
Safari – No support
Safari
footnote No support
Chrome Android – Full support
Chrome Android 127 (Release date: 2024-07-23)
footnote Full support
Firefox for Android – No support
Firefox for Android
footnote No support
Opera Android – Full support
Opera Android 84 (Release date: 2024-08-26)
footnote Full support
Safari on iOS – No support
Safari on iOS
footnote No support
Samsung Internet – Full support
Samsung Internet 28 (Release date: 2025-04-02)
footnote Full support
WebView Android – Full support
WebView Android 127 (Release date: 2024-07-23)
footnote Full support
WebView on iOS – No support
WebView on iOS
footnote No support
artwork
Experimental
Chrome – Full support
Chrome 127 (Release date: 2024-07-23)
footnote Full support
Edge – Full support
Edge 127 (Release date: 2024-07-25)
footnote Full support
Firefox – No support
Firefox
footnote No support
Opera – Full support
Opera 113 (Release date: 2024-08-22)
footnote Full support
Safari – No support
Safari
footnote No support
Chrome Android – Full support
Chrome Android 127 (Release date: 2024-07-23)
footnote Full support
Firefox for Android – No support
Firefox for Android
footnote No support
Opera Android – Full support
Opera Android 84 (Release date: 2024-08-26)
footnote Full support
Safari on iOS – No support
Safari on iOS
footnote No support
Samsung Internet – Full support
Samsung Internet 28 (Release date: 2025-04-02)
footnote Full support
WebView Android – Full support
WebView Android 127 (Release date: 2024-07-23)
footnote Full support
WebView on iOS – No support
WebView on iOS
footnote No support
startTime
Experimental
Chrome – Full support
Chrome 127 (Release date: 2024-07-23)
footnote Full support
Edge – Full support
Edge 127 (Release date: 2024-07-25)
footnote Full support
Firefox – No support
Firefox
footnote No support
Opera – Full support
Opera 113 (Release date: 2024-08-22)
footnote Full support
Safari – No support
Safari
footnote No support
Chrome Android – Full support
Chrome Android 127 (Release date: 2024-07-23)
footnote Full support
Firefox for Android – No support
Firefox for Android
footnote No support
Opera Android – Full support
Opera Android 84 (Release date: 2024-08-26)
footnote Full support
Safari on iOS – No support
Safari on iOS
footnote No support
Samsung Internet – Full support
Samsung Internet 28 (Release date: 2025-04-02)
footnote Full support
WebView Android – Full support
WebView Android 127 (Release date: 2024-07-23)
footnote Full support
WebView on iOS – No support
WebView on iOS
footnote No support
title
Experimental
Chrome – Full support
Chrome 127 (Release date: 2024-07-23)
footnote Full support
Edge – Full support
Edge 127 (Release date: 2024-07-25)
footnote Full support
Firefox – No support
Firefox
footnote No support
Opera – Full support
Opera 113 (Release date: 2024-08-22)
footnote Full support
Safari – No support
Safari
footnote No support
Chrome Android – Full support
Chrome Android 127 (Release date: 2024-07-23)
footnote Full support
Firefox for Android – No support
Firefox for Android
footnote No support
Opera Android – Full support
Opera Android 84 (Release date: 2024-08-26)
footnote Full support
Safari on iOS – No support
Safari on iOS
footnote No support
Samsung Internet – Full support
Samsung Internet 28 (Release date: 2025-04-02)
footnote Full support
WebView Android – Full support
WebView Android 127 (Release date: 2024-07-23)
footnote Full support
WebView on iOS – No support
WebView on iOS
footnote No support

Legend

Tip: you can click/tap on a cell for more information.

Full support
Full support
No support
No support
Experimental. Expect behavior to change in the future.

See also