This specification enables web developers to show personalized media recommendations on the browser UI.
This is an unofficial proposal.
This section is non-normative.
Media is used extensively today, and the Web is one of the primary means of consuming media content. Many browsers show content recommendations in their UI. This specification aims to enable web sites to specify a feed of personalized media recommendations that can be fetched by the browser and displayed in the browser UI. By improving media discovery this would improve the user experience as well as providing web sites with a new way of reaching users.
Unless otherwise stated, string comparisons are done in a case-sensitive manner.
In this document when we compare a string that starts with or equals
https://schema.org
then http://schema.org
is
valid too.
This section is non-normative.
The API introduced in this specification has very low impact with regards to security and privacy. The user agent should take care of fetching feeds based on heuristics. The site may also be able to see when their feed content is clicked by adding tracking to the media feed item url or to the media image url.
For privacy purposes, the user agent should disable the feature in incognito mode. This is because the lifetime of the incognito mode session is not long enough for this feature to be useful.
In order to not show a stale currently logged in user, the user agent should invalidate the contents of a feed in the following cases:
A cookie name filter is the name of a cookie that signals the user agent to invalidate the contents of the feed. It is intended for the website to provide the name of the login cookie so the user agent can invalidate the feed if the login session changes.
Periodic background fetching of media feeds carries the risk of exposing the list of the user's top media sites to network observers on any network the user connects to in the future. Therefore, the user agent MUST obtain consent for this feature.
This feature collects personalized information from websites including their current identity (optional) and media recommendations. This sensitive data will only be stored locally in the user's profile.
The user will have the option of switching feeds on/off at an individual feed level. The user agent will collect a feature level consent that tells the user that periodic background fetch is occuring. For feeds discovered after the feature level consent is collected, the user agent will show a popup notification when the user opens the feature which will let them know that this is occuring and provide a mechanism to disable it.
The media feed store stores media feeds that have been discovered. There can only be one media feed URL per-origin. If a user agent discovers a new media feed URL for an origin that already has a media feed URL then we will replace the existing one.
The site should advertise the Media Feed to the user agent by adding a link element to the head element, these are known as the eligible feed links. The href attribute contains the media feed URL.
Media Feeds are only discovered on top-level Documents that are a secure context.
The user agent MUST run the following steps for each eligible feed link when the Document is ready for post-load tasks:
media-feed
then return null
The user agent MUST initiate a fetch with the following request parameters:
error
The site will return the media feed document which MUST be valid JSON.
If the user agent recieves a 410 Gone status code from the site then it should remove the feed from the media feed store.
The media feed document should be a CompleteDataFeed. This has a provider property that contains an Organization to describe the publishing web site. The member field on Organization should contain a Person that contains the details about the currently logged in user. The user agent can show this to the user to identifier which account the recommendations are coming from. This is especially important if the media site supports multiple profiles.
The user agent MUST validate the media feed document using the following steps:
@context
MUST be set to https://schema.org
.
The user agent MUST validate the media feed property using the following steps:
cookieNameFilter
then the user agent MUST run the following
steps:
The user agent MUST validate the publishing web site using the following steps:
The user agent MUST validate the currently logged in user using the following steps:
{
"@context": "http://schema.org",
"@type": "CompleteDataFeed",
"dataFeedElement": [
...
]
"provider": {
"@type": "Organization",
"member": {
"@type": "Person",
"email": "beccahughes@chromium.org",
"name": "Becca Hughes",
"image": "https://www.example.org/profile_pic.jpg"
},
"name": "Media Site",
"logo": [
{
"@type": "ImageObject",
"width": 336,
"height": 188,
"url": "https://beccahughes.github.io/logo-dark-title-transparent.png",
"additionalProperty": {
"@type": "PropertyValue",
"name": "contentAttributes",
"value": ["forDarkBackground", "hasTitle", "transparentBackground"]
}
},
{
"@type": "ImageObject",
"width": 336,
"height": 188,
"url": "https://beccahughes.github.io/logo-light-title-transparent.png",
"additionalProperty": {
"@type": "PropertyValue",
"name": "contentAttributes",
"value": ["forLightBackground", "hasTitle", "transparentBackground"]
}
}
]
},
"additionalProperty": {
"@type": "PropertyValue",
"name": "cookieNameFilter",
"value": "LOGIN"
}
}
A media feed document may contain multiple media feed items. Each item represents a single item of media to be recommended to the user. Each media feed item must be one of the following media item types:
Every media feed item MUST have a media item ID that is unique within the media feed document and is a valid URL.
The user agent MUST validate every media feed item using the following steps:
@id
property MUST be set and contain a
valid media item ID.
The media feed broadcast event describes a media recommendation that could be the broadcasting schedule of a show or a live streaming event on the internet. It contains an embedded media feed item that is the media recommendation that is being broadcast.
@id
property MUST be set and contain a valid
media item ID.
Below is an example of a video that is being live streamed.
{
"@context": "https://schema.org/",
"@type": "BroadcastEvent",
"@id": "https://example.org/event",
"isLiveBroadcast": "http://schema.org/True",
"startDate": "2020-01-28T06:00:00+0000",
"endDate": "2020-01-28T07:00:00+0000",
"potentialAction": {
"@type": "WatchAction",
"target": "https://example.org/watch/video"
},
"workPerformed": {
"@context": "https://schema.org/",
"@type": "VideoObject",
"@id": "https://example.org/video",
"author": {
"@type": "Person",
"name": "Test User",
"url": "https://example.org/testuser"
},
"datePublished": "2020-01-27",
"duration": "PT5M49S",
"genre": "Animated Shorts",
"image": {
"@type": "ImageObject",
"width": 360,
"height": 480,
"url": "https://example.org/video_thumbnail.png"
},
"interactionStatistic": {
"@type": "InteractionCounter",
"interactionType": "http://schema.org/WatchAction",
"userInteractionCount": "4356"
},
"isFamilyFriendly": "http://schema.org/True",
"name": "Big Buck Bunny"
}
}
The user agent MUST use the following steps to validate a media item action. The action contains the media feed item url which is used by the user agent to launch the media item.
The content rating rates the suitability of the media feed item to its audience. It is usually a category that tells which age group is suitable to view the media.
The media item content rating can be a non-empty string containing the content rating of the media item. It can also be a Rating. If it is a Rating then the user agent MUST use the following steps to validate it:
The media item interaction statistic is a counter that counts how many interactions of a certain type (e.g. likes, views) that a media feed item has. There can be at most one media item interaction statistic for a certain type for a single media feed item.
The user agent MUST use the following steps to validate it:
The media item season represents a season of TV episodes.
The user agent MUST use the following steps to validate it:
The media item episode represents a single TV episode. It contains an embedded watch action stored in the potentialAction property.
The user agent MUST use the following steps to validate it:
The media image represents an image that can be a thumbnail that represents the content or it could be the logo for the feed. It has a number of content attributes that describe the image's type and defines its suggested usages. Depending on where the media image is embedded there are different requirements for content attributes.
The user agent MUST use the following steps to validate it:
contentAttributes
.
A media logo is a media image that is the logo for the website providing the feed. The following content attributes are required for the logo to be valid:
A media content image is a media image that is the thumbnail or poster for the media. The media content image does not require any content attributes to be valid, but it does support the following:
A content type attribute indicates to the user agent what type of content the media image contains. There can only ever be one content type content attribute per image. The attributes are defined as the following:
iconic
: The image is an artistic render of the show.
This is usually a poster or banner.
sceneStill
: The image is a still/framegrab from the
media item.
A recommended use attribute indicates to the user agent where the media image can be used. There can only ever be one recommended use content attribute per image. The attributes are defined as the following:
poster
: The image is a poster image for the show.
background
: This image is suitable for being used as
a background and does not contain text.
A background suitability attribute indicates to the user agent whether the media image is suitable for display on different backgrounds. This is important for images that have a transparent background. There can only ever be one background suitability content attribute per image. The attributes are defined as the following:
forDarkBackground
: The image is suitable for use on a
dark background.
forLightBackground
: The image is suitable for use on a
light background.
A title attribute indicates to the user agent whether the media image has a title included with the image. This is important for images that are logos that might be an icon or an icon with a title. There can only ever be one title content attribute per image. The attributes are defined as the following:
hasTitle
: The image includes the title of the media
item or website.
noTitle
: The image does not include the title.
The transparent background attribute indicates to the user
agent that the media image has a transparent background. This
is usually used for images that are the logo of the website. If this
is the case the transparentBackground
content attribute should be present.
A predominant figure position attribute indicates to the user agent where the predominant figure of the image is positioned in the media image. There can only ever be one predominant figure position content attribute per image. The attributes are defined as the following:
centered
: The predominant figure is positioned at
the center of the image.
rightCentered
: The predominant figure is positioned
to the right of the image and the left side is empty and can
be used for text overlays.
leftCentered
: The predominant figure is positioned
to the left of the image and the left side is empty and can
be used for text overlays.
A media item third party identifier is an identifier for the media feed item in a third-party system. The user agent can use it to cross reference the media feed item with media data stored in other systems.
The third party identifier name identifies the type of the third-party identifier and these are left up to the implementation. A list of known identifiers is available here.
The media item third party identifier set is a set of media item third party identifiers that contain at most one identifier per third party identifier name for a single media feed item. Any duplicates MAY be ignored by the user agent.
The user agent MUST use the following steps to validate the media item third party identifier:
This section describes how a user agent MUST validate different schema.org property types.
The user agent MUST use the following steps to convert a schema.org boolean property into a normal boolean:
https://schema.org/True
,
then return true
https://schema.org/False
,
then return false
If the property supports multiple values then the values for the property MUST be wrapped in an array. If there is only one value then it MAY be embedded directly. If there is a maximum number of values supported by a multiple value property then these MAY be ignored by the user agent.
If there are multiple values for a property then a JSON array
can be used. For example with the genre
property example below their are two genres specified:
{
"@context": "https://schema.org/",
"@type": "VideoObject",
...
"genre": {
"Action",
"Comedy"
},
...
}
If there is only one value it can be embedded directly in the property without needing an array.
{
"@context": "https://schema.org/",
"@type": "VideoObject",
...
"genre": "Action",
...
}
The type property MUST be stored using @type
for
the key and it MUST store a single non-empty string.
A user agent might want to display content for the user to continue watching. In this case the media item action can have the https://schema.org/ActiveActionStatus to indicate this.
{
"@context": "https://schema.org/",
"@type": "VideoObject",
...
"potentialAction": {
"@type": "WatchAction",
"actionStatus": "http://schema.org/ActiveActionStatus",
"startTime": "00:00:10",
"target": "https://example.org/video?time=10s"
},
...
}
A media feed item that is a TV series can have up to two TV episodes embedded in it. These can be embedded directly in the media feed item or embedded within a media item season. If there are more than two episodes they will be ignored.
The user agent MUST use the following steps to calculate the main TV episode:
A user agent might want to display the next episode in a TV series to play next. In this case, the user agent should calculate the play next episode using the following algorithm:
media-feed
This section provides the provisional registration of the
media-feed
link relation type in the link relation
type registry in accordance with Web Linking.
media-feed
Refers to a feed of personalised media recommendations relevant to the link context