将内容发布到精选轮播界面

本指南介绍了使用 Engage SDK 发布视频和直播电视内容的数据模型和集成步骤。

MovieEntity 数据模型

MovieEntity 表示一部完整电影。下表简要介绍了各个关键字段。

公共方法 类型 要求 说明
getName() 字符串 必需 电影的片名(例如“复仇者联盟 4:终局之战”)
getDescription() 字符串 必需 悬停时显示的提供背景信息的摘要
getPosterImages() List<Image> 必需 用于电影海报展示的图片列表
getPlatformSpecificPlaybackUris() List<PlatformSpecificUri> 必需 在特定平台上播放的深层链接
getDurationMillis() 长边 必需 电影的总时长(以毫秒为单位)
getCallToAction 字符串 必需 (GTV) 用于提示用户互动的文字(例如“立即观看”)
getTags List<String> 可选 用于分类的关键字(例如“动作/惊悚”)

LiveTvProgramEntity 数据模型

LiveTvProgramEntity 表示在特定频道播出或计划播出的节目。

公共方法 类型 要求 说明
getName() 字符串 必需 节目的名称(例如“NBC CT Late News”)
getDescription() 字符串 必需 提供节目背景信息的摘要
getPosterImages() List<Image> 必需 用于节目展示的图片
getAvailabilityTimeWindows() List<DisplayTimeWindow> 必需 节目的计划时间窗口
getChannelId() 字符串 必需 电视频道的唯一标识符
getChannelName() 字符串 必需 电视频道的名称
getChannelLogoImage() 图片 必需 电视频道的徽标图片
getCallToAction() 字符串 必需 (GTV) 互动提示文字
getTags() List<String> 可选 用于分类的关键字

构建器用法示例

MovieEntity 示例

请参阅 MovieEntity.Builder

MovieEntity movie = new MovieEntity.Builder()
    .setName("La hora 25")
    .setDescription("Brogan tiene 24 horas para revalorar su vida antes de ser encarcelado")
    .addPosterImage(new Image.Builder()
        .setImageUri(Uri.parse("https://www.example.com/movie_poster.png"))
        .build())
    .addPlatformSpecificPlaybackUri(new PlatformSpecificUri.Builder()
        .setUri("https://www.example.com")
        .setPlatformType(PlatformType.TYPE_TV)
        .build())
    .setDurationMillis(7200000L)
    .setCallToAction("Watch Now")
    .addTag("Action/Thriller")
    .build();

LiveTvProgramEntity 示例

请参阅 LiveTvProgramEntity.Builder

LiveTvProgramEntity liveProgram = new LiveTvProgramEntity.Builder()
    .setName("3:30AM: NBC CT Late News")
    .setDescription("The latest local news, weather and investigative stories.")
    .setChannelId("https://www.example.com")
    .setChannelName("Tastemade")
    .setChannelLogoImage(new Image.Builder()
        .setImageUri(Uri.parse("https://example.com/v1/channels/logo.png"))
        .build())
    .addAvailabilityTimeWindow(new DisplayTimeWindow.Builder()
        .setStartTimestampMillis(1756713600000L)
        .setEndTimestampMillis(1756715400000L)
        .build())
    .addPosterImage(new Image.Builder()
        .setImageUri(Uri.parse("https://example.com/v1/assets/image.jpg"))
        .build())
    .setCallToAction("Watch Now")
    .addTag("News")
    .build();

API

publishRecommendationClusters() 将用于向精选轮播界面发送候选内容。集群类型应设置为 RecommendationClusterType.TYPE_PROVIDER_ROW

Engage SDK 版本

请注意此集成所需的最低 Engage SDK 版本:

engage-tv: 1.0.6