w3c / mediasession

Media Session API
https://w3c.github.io/mediasession/
Other
129 stars 29 forks source link

Extend MediaMetadata to capture video chapter information #273

Open kimjunh opened 2 years ago

kimjunh commented 2 years ago

Media content such as youtube videos can contain chapters or markers that break down the video’s content by timestamp. (eg: https://www.youtube.com/watch?v=UOg1hHmGIQQ&t=3s) There is currently no concept of chapter information within the MediaMetadata to capture such information.

Could we extend the MediaMetadata to add fields to capture chapter information as well?

Example proposed changes:

#w3 MediaSession.MediaMetadata
[Exposed=Window]
interface MediaMetadata {
  constructor(optional MediaMetadataInit init = {});
  attribute DOMString title;
  attribute DOMString artist;
  attribute DOMString album;
  attribute FrozenArray<MediaImage> artwork;
  attribute FrozenArray<ChapterInformation> chapterInfo;
};

dictionary MediaMetadataInit {
  DOMString title = "";
  DOMString artist = "";
  DOMString album = "";
  sequence<MediaImage> artwork = [];
  sequence<ChapterInformation> chapterInfo = [];
};

dictionary ChapterInformation {
  DOMString title = ""; // The chapter's title
  double startTimeSec = ""; // The start time of the chapter in seconds
};
steimelchrome commented 11 months ago

Chrome would be interested in adding chapter information into the MediaMetadata. One thing I think is worth adding to your proposal is artwork per ChapterInformation (so the UA can display an image that represents each chapter if the website provides it).

One other thing that I think is worth discussing is whether the startTimeSec is sufficient, or if we should have a new MediaSessionAction for seeking to a chapter.

chrisn commented 11 months ago

This is on the agenda for tomorrow's Media WG meeting. cc @jan-ivar and @youennf for feedback.

marcoscaceres commented 11 months ago

never mind (deleted my comment), I thought the MediaMetadata was being proposed.

jiajiabingcheng commented 11 months ago

Hey team, I'm making the corresponding change in the specs: https://github.com/w3c/mediasession/pull/308 Can I have the write access to the repo?

tidoust commented 11 months ago

Can I have the write access to the repo?

Write access is restricted to Media Working Group participants and I cannot associate your GitHub handle with one of them. If you're in the group, please associate your GitHub handle with your W3C account. If you're not yet in the group but are affiliated with a W3C member organization, please join the group!