媒体操作 Feed 是一个 JSON 对象,其中包含一系列实体。实体是 schema.org 对象,表示目录中的项:电视剧集、电视连续剧、电影、歌曲、专辑等。

Feed 结构
观看 Action 和收听 Action 具有不同的 Feed 结构。
观看操作具有以下层次结构: |
监听 Action 具有以下层次结构: |
数据 Feed 封装容器
数据 Feed 封装容器是媒体操作 Feed 中的顶级对象。该对象包含一个 content markup object(实体)数组,表示目录中的所有内容。
数据 Feed 封装容器支持以下属性:
属性 | 类型 | 说明 |
---|---|---|
@context |
网址 | 必需 - 设置为 http://schema.org |
@type |
文本 | 必需 - 设置为 DataFeed 。 |
dateModified |
DateTime | 必填 - Feed 的上次修改日期和时间,采用 ISO 8601 格式(包括时区)。 |
dataFeedElement |
Thing 的子类型 | 必需 - 媒体目录的实体。 |
数据 Feed 封装容器模板
{
"@context": "http://schema.org",
"@type": "DataFeed",
"dateModified": "2018-07-20T00:44:51Z",
"dataFeedElement": [
{ <CONTENT MARKUP OBJECT 01> },
{ <CONTENT MARKUP OBJECT 02> },
{ <CONTENT MARKUP OBJECT 03> },
...
]
}
内容标记
内容标记对象代表目录中的单个实体:电影、电视剧集、电视连续剧、歌曲、专辑、电台等。该对象包含内容的标识符和规范网址,并有助于通过metadata描述内容。
内容标记模板
内容标记对象可以包含一个 Action 标记对象数组,以便将内容与多个 Action 标记对象相关联。例如,内容可以针对每个地区使用不同的 Action 标记对象。
{
"@context": ["http://schema.org", {"@language": "en"}],
"@type": "Movie",
"@id": "http://www.example.com/my_favorite_movie",
"url": "http://www.example.com/my_favorite_movie",
"name": "My Favorite Movie",
"potentialAction": [
{ <ACTION MARKUP OBJECT 01> },
{ <ACTION MARKUP OBJECT 02> }
],
...
}
操作标记
Action 标记对象用于描述将用户定向到内容的深层链接,以及内容所需的访问权限级别。该对象是内容标记对象的属性 (potentialAction
)。
您可以通过以下两种方式指定访问限制:
- 对于观看操作,请使用操作访问权限规范对象。
- 对于 Listen 操作,请使用offer 对象。
操作标记模板
如果内容包含多个深层链接,则 Action 标记对象包含多个目标对象。例如,内容的 iOS 深层链接可能与 Android 深层链接不同。此外,如果根据地区和时间段存在不同的访问权限限制,则一个 Action 标记对象可以有多个 Action 访问权限规范对象或优惠对象,如下面的模板所示。
适用于观看操作的 Action 标记对象模板:
"potentialAction": {
"@type": "WatchAction",
"target": [
{ <TARGET OBJECT 01> },
{ <TARGET OBJECT 02> }
],
"actionAccessibilityRequirement": [
{ <ACTION ACCESSIBILITY OBJECT 01> },
{ <ACTION ACCESSIBILITY OBJECT 02> }
]
}
适用于聆听操作的 Action 标记对象模板:
"potentialAction": {
"@type": "ListenAction",
"target": [
{ <TARGET OBJECT 01> },
{ <TARGET OBJECT 02> }
],
"expectsAcceptanceOf": [
{ <OFFER OBJECT 01> },
{ <OFFER OBJECT 02> }
]
}
目标
目标对象可将深层链接映射到各种 Google 平台。该对象是操作标记对象的属性 (target
)。
目标示例
如果内容根据平台具有多个深层链接,请创建多个目标对象以提供不同的映射。例如,内容的 Chromecast 深层链接可能与其他平台的深层链接不同,如下例所示。
目标对象示例(基本):
"target": {
"@type": "EntryPoint",
"urlTemplate": "http://www.example.com/my_favorite_movie?autoplay=true",
"actionPlatform": [
"http://schema.org/DesktopWebPlatform",
"http://schema.org/MobileWebPlatform",
"http://schema.org/AndroidPlatform",
"http://schema.org/AndroidTVPlatform",
"http://schema.org/IOSPlatform",
"http://schema.googleapis.com/GoogleVideoCast"
]
}
包含两个深层链接的目标对象示例:
"target": [
{
"@type": "EntryPoint",
"urlTemplate": "http://www.example.com/my_favorite_movie?autoplay=true",
"actionPlatform": [
"http://schema.org/DesktopWebPlatform",
"http://schema.org/MobileWebPlatform",
"http://schema.org/AndroidPlatform",
"http://schema.org/AndroidTVPlatform",
"http://schema.org/IOSPlatform"
]
},
{
"@type": "EntryPoint",
"urlTemplate": "http://www.example.com/cast/my_favorite_movie?autoplay=true",
"actionPlatform": [
"http://schema.googleapis.com/GoogleVideoCast"
]
}
]
操作访问权限规范
Action 访问权限规范对象根据地区和时间段描述内容的访问权限要求。该对象是 Action 标记对象的 actionAccessibilityRequirement
属性。
对象的 category
可以是以下任一项:
媒体订阅
媒体订阅对象用于描述内容所需的订阅的详细信息。该对象是操作访问权限规范对象的属性 requiresSubscription
。如果 actionAccessibilityRequirement.category
为 subscription
或 externalSubscription
,并且您的订阅产品/服务包含多个套餐或层级,或者支持插件,则必须提供此属性。如果您的订阅是单层级订阅,并且可访问目录中的所有内容,请勿添加此字段。
媒体订阅示例
媒体订阅对象示例:
"requiresSubscription": {
"@type": "MediaSubscription",
"@id": "http://www.example.com/premium_subscription",
"name": "Example Premium",
"sameAs": "http://www.example.com/premium_subscription"
}
优惠
优惠对象用于描述与内容相关联的价格。该对象是以下对象的属性 (expectsAcceptanceOf
):
- 对于观看操作,使用操作访问权限规范对象。
- 对于“Listen”操作,使用操作标记对象。
优惠示例
Watch 行动在操作访问权限规范对象中指定 expectsAcceptanceOf
属性:
"potentialAction":{
"@type":"WatchAction",
"target":{
"@type":"EntryPoint",
"urlTemplate":"http://www.example.com/my_favorite_movie?autoplay=true",
"actionPlatform":[ "http://schema.org/DesktopWebPlatform" ]
},
"actionAccessibilityRequirement": {
"@type": "ActionAccessSpecification",
"category": "purchase",
"availabilityStarts": "2019-01-01T00:00Z",
"availabilityEnds": "2019-12-31T00:00Z",
"eligibleRegion": {
"@type": "Country",
"name": "US"
},
"expectsAcceptanceOf": {
"@type": "Offer",
"price": 7.99,
"priceCurrency": "USD",
"seller": {
"@type": "Organization",
"name": "My example seller"
}
}
}
}
监听操作会直接在操作标记对象中指定 expectsAcceptanceOf
属性:
"potentialAction":{
"@type":"ListenAction",
"target":{
"@type":"EntryPoint",
"urlTemplate":"http://www.example.com/playlist/top_pop_songs?autoplay=true",
"actionPlatform":[ "http://schema.org/DesktopWebPlatform" ]
},
"expectsAcceptanceOf":{
"@type": "Offer",
"eligibleRegion": {
"@type":"Country",
"name":"US"
},
"category": "subscription",
"name": "Example Music",
"price": 9.99,
"priceCurrency": "USD",
"seller": {
"@type": "Organization",
"name": "My example seller",
"sameAs": "http://www.example.com"
}
}
}
图片
图片对象用于描述与内容关联的图片。
图片应满足以下要求:
- 对于观看操作,请提供宽高比为 2:3 的高分辨率图片(至少 140x210 像素)。
- 图片必须采用
.jpg
或.png
格式。
- 图片必须采用
- 对于“听”类 Action,请提供宽高比为 1x1 的高分辨率图片(至少 300x300 像素)。
- 我们建议使用 600x600 像素或更高的图片。
- 图片必须为
.jpg
、.png
或.gif
格式。
- 图片的网址必须可抓取且可编入索引。
- 您必须拥有使用相应图片的权利,并允许在 Google 设备和媒体资源上展示该图片。
- 图片不得包含以下内容:
- 图片模糊、像素化、旋转或画质不佳。
- 未经许可的照片或图库照片。
- 裸露内容。
- 非法内容。
- 更新
MusicPlaylist
时,请更新其图片以反映新内容。
图片示例
"image": {
"@type": "ImageObject",
"contentUrl" : "http://www.example.com/artist/my_favorite_artist/1x1/photo1.jpg",
"dateModified" : "2019-01-05T22:11:33+00:00",
"regionsAllowed" : ["US","UK","MX"]
}
Feed 示例
以下示例展示了观看 Action 和收听 Action 之间的 Feed 结构差异。
观看操作示例
{
"@context": "http://schema.org",
"@type": "DataFeed",
"dateModified": "2018-07-20T00:44:51Z",
"dataFeedElement": [
{
"@context": ["http://schema.org", {"@language": "en"}],
"@type": "Movie",
"@id": "http://www.example.com/my_favorite_movie",
"url": "http://www.example.com/my_favorite_movie",
"name": "My Favorite Movie",
"potentialAction": {
"@type": "WatchAction",
"target": {
"@type": "EntryPoint",
"urlTemplate": "http://www.example.com/my_favorite_movie?autoplay=true",
"inLanguage": "en",
"actionPlatform": [
"http://schema.org/DesktopWebPlatform",
"http://schema.org/MobileWebPlatform",
"http://schema.org/AndroidPlatform",
"http://schema.org/AndroidTVPlatform",
"http://schema.org/IOSPlatform",
"http://schema.googleapis.com/GoogleVideoCast"
]
},
"actionAccessibilityRequirement": {
"@type": "ActionAccessSpecification",
"category": "subscription",
"availabilityStarts": "2018-07-21T10:35:29Z",
"availabilityEnds": "2019-10-21T10:35:29Z",
"eligibleRegion": [
{
"@type": "Country",
"name": "US"
},
{
"@type": "Country",
"name": "CA"
}
],
}
},
"sameAs": "https://en.wikipedia.org/wiki/my_favorite_movie",
"releasedEvent": {
"@type": "PublicationEvent",
"startDate": "2008-01-20",
"location": {
"@type": "Country",
"name": "US"
}
},
"description": "This is my favorite movie.",
"actor": [
{
"@type": "Person",
"name": "John Doe",
"sameAs": "https://en.wikipedia.org/wiki/John_Doe"
},
{
"@type": "Person",
"name": "Jane Doe",
"sameAs": "https://en.wikipedia.org/wiki/Jane_Doe"
}
],
"identifier": [
{
"@type": "PropertyValue",
"propertyID": "IMDB_ID",
"value": "tt0123456"
}
]
}
]
}
聆听操作示例
{
"@context": "http://schema.org",
"@type": "DataFeed",
"dateModified": "2018-07-20T00:44:51Z",
"dataFeedElement": [
{
"@context":"http://schema.googleapis.com/",
"@type":"MusicGroup",
"@id":"http://www.example.com/artist/my_favorite_artist/",
"url":"http://www.example.com/artist/my_favorite_artist/",
"name":"My Favorite Artist",
"sameAs":"https://en.wikipedia.org/wiki/my_favorite_artist",
"description":"This is my favorite pop music artist.",
"potentialAction": {
"@type":"ListenAction",
"target": {
"@type":"EntryPoint",
"urlTemplate":"http://www.example.com/artist/my_favorite_artist?autoplay=true",
"actionPlatform":[
"http://schema.org/DesktopWebPlatform",
"http://schema.org/IOSPlatform",
"http://schema.org/AndroidPlatform",
"http://schema.org/AndroidTVPlatform",
"http://schema.googleapis.com/GoogleAudioCast",
"http://schema.googleapis.com/GoogleVideoCast"
]
},
"expectsAcceptanceOf":{
"@type":"Offer",
"category":"subscription",
"eligibleRegion": {
"@type":"Country",
"name":"US"
},
"price": 8.99,
"priceCurrency": "USD"
}
},
"subjectOf": {
"@type":"MusicPlaylist",
"@id":"http://www.example.com/artist_mix/my_favorite_artist/",
"url":"http://www.example.com/artist_mix/my_favorite_artist/",
"name":"My Favorite Artist Mix",
"description":"A mix of music similar to My Favorite Artist",
"potentialAction":{
"@type":"ListenAction",
"target": {
"@type":"EntryPoint",
"urlTemplate":"http://www.example.com/artist_mix/my_favorite_artist?autoplay=true",
"actionPlatform":[
"http://schema.org/DesktopWebPlatform",
"http://schema.org/IOSPlatform",
"http://schema.org/AndroidPlatform",
"http://schema.org/AndroidTVPlatform",
"http://schema.googleapis.com/GoogleAudioCast",
"http://schema.googleapis.com/GoogleVideoCast"
]
},
"expectsAcceptanceOf":{
"@type":"Offer",
"category":"free",
"eligibleRegion": {
"@type":"Country",
"name":"US"
}
}
}
}
}
]
}