向“接下来观看”频道添加节目
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
“接下来观看”频道是显示在主屏幕中的第二行,
应用行。此频道由系统创建和维护。您的应用可以添加
“接下来观看”频道:
有趣、中途停止观看或与内容相关的内容
用户正在观看的内容(例如电视剧的下一集或某电视剧的下一季)
)。
“接下来观看”频道有一些限制:您的应用无法移动、移除或
隐藏“接下来观看”频道所在的行
步骤
向“接下来观看”频道插入节目的步骤与
在自己的频道中插入节目。
请参阅以下部分,详细了解“接下来观看”频道。
发布到 Google TV 上的“接下来观看”频道(显示为“继续”
需要事先通过认证流程获得 Google 的批准,并且
使用服务器端处理技术根据节目的属性对其进行排序。
如需开始认证流程,请
请提交此关联的表单。
将内容插入“接下来观看”频道时,您必须遵循以下准则:
选择节目类型
“接下来观看”节目有四种类型。请选择合适的类型:
类型 | 备注 |
WATCH_NEXT_TYPE_CONTINUE | 用户在观看过程中停止播放。 |
WATCH_NEXT_TYPE_NEXT | 用户正在观看的连续剧中的下一个节目
可用。例如,如果用户正在观看一部电视连续剧的第 3 集,应用可以建议用户接下来观看第 4 集。 |
WATCH_NEXT_TYPE_NEW | 明确排在用户观看的内容后面的新内容现已可供观看。例如,用户正在观看一部电视连续剧的第 5 集,而第 6 集已可供观看。 |
WATCH_NEXT_TYPE_WATCHLIST | 由系统或应用在用户保存节目时插入。 |
如需了解详情,请参阅“接下来观看”属性。
使用 WatchNextProgram 构建器
请使用 WatchNextProgram.Builder
。如需了解详情,请参阅
“接下来观看”属性。
Kotlin
val builder = WatchNextProgram.Builder()
builder.setType(TvContractCompat.WatchNextPrograms.TYPE_MOVIE)
.setWatchNextType(TvContractCompat.WatchNextPrograms.WATCH_NEXT_TYPE_CONTINUE)
.setLastEngagementTimeUtcMillis(time)
.setTitle("Title")
.setDescription("Program description")
.setPosterArtUri(uri)
.setIntentUri(uri)
.setInternalProviderId(appProgramId)
val watchNextProgramUri = context.contentResolver
.insert(TvContractCompat.WatchNextPrograms.CONTENT_URI,
builder.build().toContentValues())
Java
WatchNextProgram.Builder builder = new WatchNextProgram.Builder();
builder.setType(TvContractCompat.WatchNextPrograms.TYPE_MOVIE)
.setWatchNextType(TvContractCompat.WatchNextPrograms.WATCH_NEXT_TYPE_CONTINUE)
.setLastEngagementTimeUtcMillis(time)
.setTitle("Title")
.setDescription("Program description")
.setPosterArtUri(uri)
.setIntentUri(uri)
.setInternalProviderId(appProgramId);
Uri watchNextProgramUri = context.getContentResolver()
.insert(TvContractCompat.WatchNextPrograms.CONTENT_URI, builder.build().toContentValues());
使用 TvContractCompat.buildWatchNextProgramUri(long watchNextProgramId)
执行以下操作:
创建更新“接下来观看”节目所需的 Uri
。
当用户向“接下来观看”频道添加节目时,系统会将
到行。它会将 intent
TvContractCompat.ACTION_PREVIEW_PROGRAM_ADDED_TO_WATCH_NEXT
,用于通知应用
节目已添加。该 intent 包含两个 extra:计划 ID
以及“接下来观看”部分中为该节目创建的节目 ID
。
本页面上的内容和代码示例受内容许可部分所述许可的限制。Java 和 OpenJDK 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-07-27。
[null,null,["最后更新时间 (UTC):2025-07-27。"],[],[],null,["# Add programs to the Watch Next channel\n\nThe Watch Next channel is the second row that appears in the home screen, after\nthe apps row. The system creates and maintains this channel. Your app can add\nprograms to the Watch Next channel: programs that the user marked as\ninteresting, stopped watching in the middle, or that are related to the content\nthe user is watching (like the next episode in a series or next season of a\nshow).\n| **Note:** On the home screen, the Watch Next channel has the label **Play Next** . However, the Android classes used to manage the Watch Next channel are [`WatchNextProgram`](/reference/androidx/tvprovider/media/tv/WatchNextProgram) and [`WatchNextPrograms`](/reference/android/media/tv/TvContract.WatchNextPrograms). They have methods and constants with the stem \"watchnext\".\n\nThe Watch Next channel has some constraints: your app cannot move, remove, or\nhide the Watch Next channel's row.\n\nSteps\n-----\n\nInserting programs into the Watch Next channel is similar to\n[inserting programs into your own channel](/training/tv/discovery/recommendations-channel#add-programs).\nSee the following sections for details specific to Watch Next.\n\nPublishing to the Watch Next channel on Google TV (displayed as \"Continue\nwatching\") requires prior approval by Google through a certification process and\nuses server-side processing to sort programs based on their attributes.\nTo start the certification process, please\nsubmit this [linked form](https://docs.google.com/forms/d/e/1FAIpQLSeaNhHjDNM8osXPgkXeUQMSl5CntaEw0EeGYHIAc5jxUhQuHg/viewform).\n\nWhen inserting content into the Watch Next channel, you must follow these guidelines:\n\n- [Watch Next guidelines for app developers](/training/tv/discovery/guidelines-app-developers)\n- [Watch Next guidelines for TV providers](/training/tv/discovery/guidelines-tv-providers)\n\n### Select a type of program\n\nThere are four types of Watch Next programs. Select the appropriate type:\n\n| Type | Notes |\n|-----------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `WATCH_NEXT_TYPE_CONTINUE` | The user stopped while watching content. |\n| `WATCH_NEXT_TYPE_NEXT` | The next available program in a series the user is watching is available. For example, if the user is watching episode 3 of a series, the app can suggest that they watch episode 4 next. |\n| `WATCH_NEXT_TYPE_NEW` | New content that clearly follows what the user is watching is now available. For example, the user is watching episode number 5 from a series and episode 6 becomes available for watching. |\n| `WATCH_NEXT_TYPE_WATCHLIST` | Inserted by the system or the app when the user saves a program. |\n\nFor more information, see [Watch Next attributes](/training/tv/discovery/watch-next-programs).\n\n### Use the WatchNextProgram builder\n\nUse a `WatchNextProgram.Builder`. For more information, see\n[Watch Next attributes](/training/tv/discovery/watch-next-programs). \n\n### Kotlin\n\n```kotlin\nval builder = WatchNextProgram.Builder()\nbuilder.setType(TvContractCompat.WatchNextPrograms.TYPE_MOVIE)\n .setWatchNextType(TvContractCompat.WatchNextPrograms.WATCH_NEXT_TYPE_CONTINUE)\n .setLastEngagementTimeUtcMillis(time)\n .setTitle(\"Title\")\n .setDescription(\"Program description\")\n .setPosterArtUri(uri)\n .setIntentUri(uri)\n .setInternalProviderId(appProgramId)\n\nval watchNextProgramUri = context.contentResolver\n .insert(TvContractCompat.WatchNextPrograms.CONTENT_URI,\n builder.build().toContentValues())\n```\n\n### Java\n\n```java\nWatchNextProgram.Builder builder = new WatchNextProgram.Builder();\nbuilder.setType(TvContractCompat.WatchNextPrograms.TYPE_MOVIE)\n .setWatchNextType(TvContractCompat.WatchNextPrograms.WATCH_NEXT_TYPE_CONTINUE)\n .setLastEngagementTimeUtcMillis(time)\n .setTitle(\"Title\")\n .setDescription(\"Program description\")\n .setPosterArtUri(uri)\n .setIntentUri(uri)\n .setInternalProviderId(appProgramId);\n\nUri watchNextProgramUri = context.getContentResolver()\n .insert(TvContractCompat.WatchNextPrograms.CONTENT_URI, builder.build().toContentValues());\n```\n\nUse `TvContractCompat.buildWatchNextProgramUri(long watchNextProgramId)` to\ncreate the `Uri` you need to update a Watch Next program.\n\nWhen the user adds a program to the Watch Next channel, the system copies the\nprogram to the row. It sends the intent\n`TvContractCompat.ACTION_PREVIEW_PROGRAM_ADDED_TO_WATCH_NEXT` to notify the app\nthat the program has been added. The intent includes two extras: the program ID\nthat was copied and the program ID created for the program in the Watch Next\nchannel."]]