用户更喜欢观看或收听他们已经可以访问的内容,例如现有的订阅内容。如果 Google 知道用户可以在您的应用或平台上访问哪些内容,就可以构建更好的搜索结果或响应,将用户定向到相应内容。
确定内容访问要求
您必须确定目录中每个内容包的访问权限要求。在此过程中,请考虑以下问题:
- 用户是否需要登录您的应用或平台才能访问内容?
用户是否需要订阅?
仅限观看操作:
- 用户是否需要从外部服务提供商处订阅?
- 您是否提供分层订阅、多软件包订阅或附加订阅?
仅限观看操作:用户是否需要租借或购买相应内容?
访问要求会随着时间推移而变化吗?
访问要求是否取决于设备的位置?
访问限制类型
访问限制有两种:
付费墙类型
您可以按付费墙类型限制对内容的访问。下表详细说明了不同的付费墙类型:
付费墙类型 | 示例 | 类别 |
---|---|---|
无需购买或登录。 | 碎裂 | nologinrequired |
用户必须登录,但不需要付费订阅。 | Vudu (AVOD) | free |
用户必须拥有有效订阅。访问权限与订阅层级无关。 | Netflix |
|
用户必须拥有有效订阅。访问权限取决于订阅层级。 | Hulu(插件) |
|
购买后,可在限定时间内观看相应内容。 | Vudu | rental |
购买后,相应内容可无限期显示。 | Vudu | purchase |
该内容可通过有线订阅服务获得。 | HBO Go | externalSubscription |
观看操作对应的付费墙类型
如需为观看操作指定内容付费墙类型,请使用操作访问权限规范中的 category
属性:
"potentialAction": {
"@type":"WatchAction",
"target": { … },
"actionAccessibilityRequirement": {
"@type": "ActionAccessSpecification",
"category": "subscription",
"availabilityStarts": "2018-06-01T10:35:29Z",
"availabilityEnds": "2019-05-31T10:35:29Z",
"eligibleRegion": {
"@type": "Country",
"name": "US"
}
},
...
}
监听 Action 的付费墙类型
如需为“监听操作”指定内容付费墙类型,请使用优惠对象中的 category
属性:
"potentialAction": {
"@type":"ListenAction",
"target": { … },
"expectsAcceptanceOf":{
"@type":"Offer",
"category":"subscription",
"availabilityStarts": "2018-06-01T10:35:29Z",
"availabilityEnds": "2019-05-31T10:35:29Z",
"eligibleRegion": {
"@type":"Country",
"name":"US"
}
},
...
}
地理区域
您必须指定内容的地理区域。您可以使用以下一个或两个属性:
如果设备位置在 eligibleRegion
中指定的任何区域内,并且不在 ineligibleRegion
中指定的任何区域内,用户就可以访问内容。
eligibleRegion
和 ineligibleRegion
属性允许使用以下值:
Country
、City
和State
的列表。GeoShape
对象。如需了解详细要求,请参阅GeoShape
属性部分。GeoShape
对象的列表。
如果内容可在全球范围内使用,请为 eligibleRegion
使用以下特殊值:
"eligibleRegion": "EARTH",
eligibleRegion 用例
以下是 eligibleRegion
属性的用例示例:
- 示例 1:
eligibleRegion
(包含国家/地区列表)。 - 示例 2:
eligibleRegion
,其GeoShape
对象包含一系列邮政编码。 - 示例 3:
eligibleRegion
,其GeoShape
对象包含一系列前向排序区域 (FSA) 代码。 - 示例 4:
eligibleRegion
,其中包含包含 DMA ID 的GeoShape
对象。 - 示例 5:
eligibleRegion
,带有GeoShape
对象的列表。每个 DMA ID 均包含。 - 示例 6:
ineligibleRegion
(包含已被屏蔽的邮政编码)。
示例 1
eligibleRegion
,其中包含国家/地区列表:
"actionAccessibilityRequirement": { "@type": "ActionAccessSpecification", "category": "subscription", "requiresSubscription": { "@type": "MediaSubscription", "@id": "http://www.example.com/north_america_network/subscription", "name": "Example Subscription", "commonTier": true }, "eligibleRegion": [ { "@type": "Country", "name": "US" }, { "@type": "Country", "name": "CA" } ] }
示例 2
将 eligibleRegion
替换为 GeoShape
对象,该对象包含一系列邮政编码:
"actionAccessibilityRequirement": { "@type": "ActionAccessSpecification", "category": "subscription", "requiresSubscription": { "@type": "MediaSubscription", "@id": "http://www.example.com/local_tv_network/subscription", "name": "Example Subscription", "commonTier": true }, "eligibleRegion": { "@type": "GeoShape", "@id": "http://example.com/area1", "addressCountry": "US", "postalCode": [ "94118", "94119" ] } }
示例 3
将 eligibleRegion
替换为 GeoShape
对象,该对象包含前向排序区域 (FSA) 代码列表:
"actionAccessibilityRequirement": { "@type": "ActionAccessSpecification", "category": "subscription", "requiresSubscription": { "@type": "MediaSubscription", "@id": "http://www.example.com/local_tv_network/subscription", "name": "Example Subscription", "commonTier": true }, "eligibleRegion":{ "@type": "GeoShape", "@id": "http://example.com/area2", "addressCountry": "CA", "postalCode": [ "1A1", "K1A" ] } }
示例 4
将 eligibleRegion
替换为包含 DMA ID 的 GeoShape
对象:
"actionAccessibilityRequirement": { "@type": "ActionAccessSpecification", "category": "subscription", "requiresSubscription": { "@type": "MediaSubscription", "@id": "http://www.example.com/abcd/subscription", "name": "Example Subscription", "commonTier": true }, "eligibleRegion":{ "@type": "GeoShape", "@id": "http://example.com/area3", "addressCountry": "US", "identifier": [ { "@type": "PropertyValue", "propertyID": "DMA_ID", "value": "501" } ] } }
示例 5
将 eligibleRegion
替换为 GeoShape
对象列表。每个都包含一个 DMA ID:
"actionAccessibilityRequirement" : { "@type" : "ActionAccessSpecification", "eligibleRegion" : [ { "@id" : "http://example.com/dma/601", "@type" : "GeoShape", "addressCountry" : "US", "identifier" : { "@type" : "PropertyValue", "propertyID" : "DMA_ID", "value" : "601" } }, { "@id" : "http://example.com/dma/602", "@type" : "GeoShape", "addressCountry" : "US", "identifier" : { "@type" : "PropertyValue", "propertyID" : "DMA_ID", "value" : "602" } } ] }
示例 6
ineligibleRegion
(有被屏蔽的邮政编码):
"actionAccessibilityRequirement": { "@type": "ActionAccessSpecification", "category": "subscription", "requiresSubscription": { "@type": "MediaSubscription", "@id": "http://www.example.com/local_tv_network/subscription", "name": "Example Subscription", "commonTier": true }, "eligibleRegion": { "@type": "Country", "name": "US" }, "ineligibleRegion": { "@type": "GeoShape", "@id": "http://example.com/area1", "addressCountry": "US", "postalCode": [ "94118", "94119" ] } }
使用权标识符
权利标识符 entitlementId
表示一个字符串,表示对媒体目录中一组内容的访问权限。为了确定用户是否有权访问您的内容,Google 会执行以下步骤:
- 我们会对您的权限端点进行 API 调用,以接收用户的权限标识符。
- 我们会从您的媒体操作 Feed 中查找内容所需的权利标识符。
- 我们会将用户的
entitlementId
与 Feed 中媒体订阅对象的identifier
属性进行匹配。如果至少有一个entitlementId
匹配,我们会确定用户可以访问相应内容。
Google 建议您对 entitlementId
使用以下语法:
<domain name> + colon (:) + <access level to content>
语法示例:
example.com:basic
example.com:premium
example.com:sports
使用权标识符示例
MediaExampleCompany 的 Feed 规定 Movie XYZ
需要 example.com:basic
entitlementId
,如下所示:
{ "@context": ["http://schema.org", {"@language": "en"}], "@type": "Movie", "@id": "www.example.com/movie_xyz", "url": "www.example.com/movie_xyz", "name": "Movie XYZ", "potentialAction": { "@type": "WatchAction", "target": [ … ], "actionAccessibilityRequirement": { "@type": "ActionAccessSpecification", "category": "subscription", "requiresSubscription": { "@type": "MediaSubscription", "@id": "http://www.example.com/basic_subscription", "name": "Basic subscription", "commonTier": true ... }, ... } }, ... }
常见访问用例
以下是常见的访问用例:
- 免费(无需登录):无需登录、订阅或购买即可获取内容。
- 免费(需要登录):这种内容要求用户登录,但不需要订阅。
- 单层级订阅:内容需要订阅。所有订阅者(无论其订阅套餐如何)都可以访问相同的内容,无论电影还是剧集。
- 多层级订阅:内容需要订阅。订阅者可以访问不同的内容(无论是电影还是剧集),具体取决于其订阅层级。例如,白银级与黄金级。
- 附加订阅:内容需要订阅。订阅者可以在其常规订阅的基础上添加付费内容。
- 一次性购买:用户可以购买内容,之后用户可以无限期地访问。
- 直播电视:订阅包含对本地、全国和付费频道的访问。
- 第三方订阅:相关内容要求用户使用有线电视服务提供商登录。
免费(无需登录)
无需登录
相关内容无需登录或订阅即可使用。
{ "actionAccessibilityRequirement": { "@type": "ActionAccessSpecification", "category": "nologinrequired", "availabilityStarts": "2015-01-01T00:00Z", "availabilityEnds": "2015-12-31T00:00Z", "eligibleRegion": { "@type": "Country", "name": "US" } } }
- 将
category
设为nologinrequired
。 - 请勿添加
expectAcceptanceOf
。
免费(需要登录)
需要登录
该内容要求用户登录,但不需要订阅。
{ "actionAccessibilityRequirement": { "@type": "ActionAccessSpecification", "category": "free", "availabilityStarts": "2015-01-01T00:00Z", "availabilityEnds": "2015-12-31T00:00Z", "eligibleRegion": { "@type": "Country", "name": "US" } } }
- 将
category
设为free
。 - 请勿添加
expectAcceptanceOf
。
单层级订阅
在单层级订阅模式下,服务提供商有一个订阅层级。所有订阅者(无论其订阅套餐如何)都可以访问相同的内容,无论电影还是剧集。
{ "actionAccessibilityRequirement": { "@type": "ActionAccessSpecification", "category": "subscription", "availabilityStarts": "2015-01-01T00:00Z", "availabilityEnds": "2015-12-31T00:00Z", "requiresSubscription": { "@type": "MediaSubscription", "name": "Example Package", "commonTier": true, "@id": "http://www.example.com/example_package" }, "eligibleRegion": { "@type": "Country", "name": "US" } } }
多层级订阅
在分层订阅模式下,服务提供商具有多个订阅层级,例如黄金级、白银级和青铜级。订阅级别较高的用户可以访问所有级别较低的内容。但是,订阅较低层级的用户无法访问较高层级的内容。
请考虑以下场景:
- Jane 订阅了 Gold 层级。您的授权端点会返回以下
entitlementId
标识符:example.com:bronze
example.com:silver
example.com:gold
- John 订阅了“青铜级”层级。您的授权端点会返回以下
entitlementId
:example.com:bronze
- 您的媒体操作 Feed 说明了以下要求:
- 电影 A 需要
example.com:bronze
。 - 电影 B 需要
example.com:silver
。
- 电影 A 需要
在这种情况下,Google 会为 Jane 和 John 确定以下访问权限级别:
- Jane 和 John 都可以观看电影 A。
- Jane 可以访问电影 B,但 John 无权访问。
{ "actionAccessibilityRequirement": { "@type": "ActionAccessSpecification", "category": "subscription", "requiresSubscription": { "@type": "MediaSubscription", "@id": "http://www.example.com/basic_subscription", "name": "Bronze", "commonTier": true ... }, ... } }
附加订阅
在插件订阅模式下,服务提供商允许用户扩展其订阅权利,并将频道添加到基本订阅中。用户可以根据需要添加任意数量的频道。
请考虑以下场景:
- 除了基本订阅之外,Jane 还有 PRO 和 Sportz。您的授权端点会返回以下
entitlementId
标识符:example.com:basic
example.com:pro
example.com:sportz
- John 只有 Basic 订阅。您的授权端点会返回以下
entitlementId
:example.com:basic
- 您的媒体操作 Feed 说明了以下要求:
- 电影 A 需要
example.com:basic
。 - 电影 B 需要
example.com:pro
。
- 电影 A 需要
在这种情况下,Google 会为 Jane 和 John 确定以下访问权限级别:
- Jane 和 John 都可以观看电影 A。
- Jane 可以访问电影 B,但 John 无权访问。
{ "actionAccessibilityRequirement": { "@type": "ActionAccessSpecification", "category": "subscription", "availabilityStarts": "2015-01-01T00:00Z", "availabilityEnds": "2015-12-31T00:00Z", "eligibleRegion": { "@type": "Country", "name": "US" "requiresSubscription": [ { "@type": "MediaSubscription", "@id": "https://www.example.com/package/basic", "name": "Basic", "sameAs": "https://www.example.com/package/basic", "commonTier": true }, { "@type": "MediaSubscription", "@id": "https://www.example.com/packages/basic/pro", "name": "PRO", "sameAs": "https://www.example.com/package/pro", "identifier": "example.com:pro", "commonTier": false }, { "@type": "MediaSubscription", "@id": "https://www.example.com/package/sportz", "name": "Sportz", "sameAs": "https://www.example.com/package/sports", "identifier": "example.com:sportz", "commonTier": false } } } }
一次性购买
购买
购买后,相应内容可无限期显示。
{ "actionAccessibilityRequirement": { "@type": "ActionAccessSpecification", "category": "purchase", "availabilityStarts": "2015-01-01T00:00Z", "availabilityEnds": "2015-12-31T00:00Z", "eligibleRegion": { "@type": "Country", "name": "US" }, "expectsAcceptanceOf": { "@type": "Offer", "price": 7.99, "priceCurrency": "USD", "seller": { "@type": "Organization", "name": "Example", "sameAs": "http://www.example.com/" } } } }
- 将
category
设为purchase
。 - 在
actionAccessibilityRequirement
中添加expectAcceptanceOf
以指示购买价格。
租借
购买后,可在限定时间内观看相应内容。
{ "actionAccessibilityRequirement": { "@type": "ActionAccessSpecification", "category": "rental", "availabilityStarts": "2015-01-01T00:00Z", "availabilityEnds": "2015-12-31T00:00Z", "eligibleRegion": { "@type": "Country", "name": "US" }, "expectsAcceptanceOf": { "@type": "Offer", "price": 7.99, "priceCurrency": "USD", "seller": { "@type": "Organization", "name": "Example", "sameAs": "http://www.example.com/" } } } }
- 将
category
设为rental
。 - 在
actionAccessibilityRequirement
中添加expectAcceptanceOf
以指示租借价格。
电视直播
第三方订阅
第三方订阅
订阅者可以通过其他服务访问此内容。
{ "actionAccessibilityRequirement": { "@type": "ActionAccessSpecification", "category": "externalsubscription" "availabilityStarts": "2015-01-01T00:00Z", "availabilityEnds": "2015-12-31T00:00Z", "requiresSubscription":{ "@type": "MediaSubscription", "@id": "https://www.example.com/faq", "name": "Example", "sameAs": "https://www.example.com/faq", "authenticator": { "@type": "Organization", "name": "TVE" } }, "eligibleRegion": { "@type": "Country", "name": "US" } } }
- 添加
authenticator
以指示其他服务对订阅者进行身份验证。例如,HBO GO 要求订阅有线电视提供商。
通用层级软件包
所有订阅者(无论其订阅包如何)都可以使用通用层级内容。通用层级适用于 category
为 subscription
的所有内容。如需详细了解 category
属性,请参阅付费墙类型部分。
为什么需要通用层级软件包?
多个 Google 产品(包括 Google 搜索、Android TV 和 Google 助理)可为用户提供电视和电影推荐。如需为用户设定对费用的预期,Google 必须了解通过使用公共层级向所有订阅者提供的内容。Google 还必须了解提供特定订阅套餐的订阅者可观看哪些内容。
除非您支持 Etitlement API,否则 Google 建议您采用通用层级提供的影视内容。该 API 可让 Google 了解每个用户可以访问的非通用层级标题。
应在何时创建通用层级软件包?
如果您的服务提供面向所有订阅者的内容,则必须提供通用层级软件包。这包括仅提供一个软件包的服务以及提供多个软件包或插件的服务。
如果提供程序没有向所有订阅者提供任何内容,则不需要创建通用层级软件包。例如,服务提供商在其所有软件包中提供互斥内容。
常见层级示例
以下是常见层级的示例。
分层订阅
在分层订阅模式下,服务提供商具有多个订阅层级,例如黄金级、白银级和青铜级。采用上一层级订阅的用户可以访问较低层级的所有内容。订阅较低层级的用户无权访问较高层级的内容。下图是软件包结构的一个示例。
在下面的代码示例中,青铜级软件包是通用级,因为所有用户都可以访问该级层级中的所有内容。
"requiresSubscription": [ { "@type": "MediaSubscription", "@id": "https://www.example.com/package/bronze", "name": "Bronze", "sameAs": "https://www.example.com/package/bronze", "commonTier": true }, { "@type": "MediaSubscription", "@id": "https://www.example.com/package/silver", "name": "Silver", "sameAs": "https://www.example.com/package/silver", "identifier": "example.com:silver", "commonTier": false }, { "@type": "MediaSubscription", "@id": "https://www.example.com/package/gold", "name": "Gold", "sameAs": "https://www.example.com/package/gold", "identifier": "example.com:gold", "commonTier": false } ],
插件
在插件订阅模式下,服务提供商允许用户扩展其使用权,并为基本订阅添加频道。用户可以根据需要添加任意数量的频道。下图是软件包结构的一个示例。
如果您有一个可供所有用户使用的频道,并且该频道没有任何费用,则可以将该软件包与通用层级软件包合并。
在以下代码示例中,基本软件包是通用层级,因为所有用户都可以访问此软件包中的所有内容。
"requiresSubscription": [ { "@type": "MediaSubscription", "@id": "https://www.example.com/package/basic", "name": "Basic", "sameAs": "https://www.example.com/package/basic", "commonTier": true }, { "@type": "MediaSubscription", "@id": "https://www.example.com/packages/basic/pro", "name": "PRO", "sameAs": "https://www.example.com/package/pro", "identifier": "example.com:pro", "commonTier": false }, { "@type": "MediaSubscription", "@id": "https://www.example.com/package/sportz", "name": "Sportz", "sameAs": "https://www.example.com/package/sports", "identifier": "example.com:sportz", "commonTier": false }, { "@type": "MediaSubscription", "@id": "https://www.example.com/package/moviemax", "name": "Moviemax", "sameAs": "https://www.example.com/package/moviemax", "identifier": "example.com:moviemax", "commonTier": false } ],
内容包含相交的内容包
在内容包中内容相交的内容模型中,服务提供商销售的软件包包含来自其他软件包的一些内容。下图是软件包结构的一个示例。
在以下代码示例中,提供程序提供了三个软件包,其中一些内容在所有软件包中相交。在这种情况下,需要使用第四个表示通用层级的软件包。必须包含所有三个软件包中提供的所有内容。
"requiresSubscription": [ { "@type": "MediaSubscription", "@id": "https://www.example.com/package/1", "name": "Package 1", "sameAs": "https://www.example.com/package/1", "identifier": "example.com:package1", "commonTier": false }, { "@type": "MediaSubscription", "@id": "https://www.example.com/package/2", "name": "Package 2", "sameAs": "https://www.example.com/package/2", "identifier": "example.com:package2", "commonTier": false }, { "@type": "MediaSubscription", "@id": "https://www.example.com/package/3", "name": "Package 3", "sameAs": "https://www.example.com/package/3", "identifier": "example.com:package3", "commonTier": false }, { "@type": "MediaSubscription", "@id": "https://www.example.com/package/common", "name": "Common Tier Package", "sameAs": "https://www.example.com/package/common", "commonTier": true } ],
内容没有交集的文件包
在所有内容包不相交的内容模型中,服务提供商销售的软件包不包含来自其他软件包的内容。下图是软件包结构的一个示例。
在以下示例中,提供程序提供了三个软件包,其中没有任何内容在所有软件包中相交。不需要通用层级软件包。
"requiresSubscription": [ { "@type": "MediaSubscription", "@id": "https://www.example.com/package/1", "name": "Package 1", "sameAs": "https://www.example.com/package/1", "identifier": "example.com:package1", "commonTier": false }, { "@type": "MediaSubscription", "@id": "https://www.example.com/package/2", "name": "Package 2", "sameAs": "https://www.example.com/package/2", "identifier": "example.com:package2", "commonTier": false }, { "@type": "MediaSubscription", "@id": "https://www.example.com/package/3", "name": "Package 3", "sameAs": "https://www.example.com/package/3", "identifier": "example.com:package3", "commonTier": false } ],
授权端点
使用本部分中的信息来托管 HTTPS 端点,该端点会返回与用户关联的授权。
先决条件
在开始之前,请先验证您的服务是否支持 Google 的 OAuth 2.0 流程。
请求
为了接收用户的权限,Google 会发送包含用户的 OAuth 令牌的请求。您的端点需要根据该 OAuth 令牌来识别用户。请参阅以下示例:
GET /resource HTTP/1.1
Host: server.example.com
Authorization: Bearer <OAuthToken>
响应
您的端点需要返回具有以下属性的响应:
属性 | |
---|---|
subscription |
必需 这是根响应中的字段。 |
subscription.type |
必需 此属性可具有以下值:
|
subscription.expiration_date |
可选 此订阅的到期日期,采用 ISO 8601 格式,包括时区。如需了解详情,请参阅失效日期。 |
entitlements |
可选 此根属性包含用户保存的 |
entitlements.entitlement |
如果对流式传输目录的访问权限因订阅类型而异,则此属性为必需属性。 此属性包含 |
entitlements.expiration_date |
可选 此订阅的失效日期,采用 ISO 8601 格式,包括时区。如需了解详情,请参阅失效日期。 |
失效日期
端点响应中有两个用于处理失效日期的属性:subscription.expiration_date
和 entitlements.expiration_date
。您可以只加入其中一个,也可以不加入,但不能同时加入。使用哪种方式取决于您的订阅模式。
订阅模式 | |
---|---|
所有订阅者对您流式传输目录的访问权限都相同。 | 由于您无需指定 entitlements 属性,因此请指定 subscription.expiration_date 。 |
对流目录的访问权限取决于用户订阅的详情。 |
如果您的订阅模式包含多个随时间过期的层级或插件,请执行以下操作之一:
|
示例回复
以下是不同订阅状态的示例响应:
- 有效订阅
- 设有失效日期的有效订阅
- 无订阅项目
- 有效订阅多个层级或插件
有效订阅
有效订阅
用户对 example.com 具有有效订阅。在这种情况下,无论订阅类型如何,所有订阅者都可以访问您的整个流媒体目录。
{ "subscription" : { "type": "ActiveSubscription", } }
设有失效日期的有效订阅
有效订阅(有失效日期)
用户具有对 example.com 的有效订阅,并且订阅有失效日期。在这种情况下,无论订阅类型如何,所有订阅者都可以访问您的整个流式传输目录。
{ "subscription" : { "type": "ActiveSubscription", "expiration_date": "2019-11-10T10:00:00Z" } }
无订阅项目
无订阅
用户没有 example.com 订阅。
{ "subscription" : { "type": "InactiveSubscription" } }
有效订阅多个层级或插件
有效订阅多个层级或插件
用户在特定日期前订阅了 example.com:premium
。
{ "subscription" : { "type": "ActiveSubscription", } "entitlements": [ { "entitlement": "example.com:premium", "expiration": "2019-11-10T10:00:00Z" } ] }
速率限制
Google 最多每 6 小时刷新一次用户的权限信息。为了均衡每秒查询次数 (QPS) 的上限,Google 会在一段时间内将查询均匀地分配到您的端点。因此,您可以使用以下公式估算端点的预期平均 QPS:
预期平均 QPS = <用户总数>/21600 秒(6 小时 x 60 分钟 x 60 秒)
如果您支持大量用户,Google 可以调整 6 小时的时间间隔。如有必要,请与 Google 联系,讨论相关配置。
与 Google 联系
端点准备就绪后,请与 Google 联系以告知端点的网址。
操作访问规范属性
如需了解参考信息,请参阅操作访问规范属性部分。