將內容發布至精選輪播介面

本指南說明如何使用 Engage SDK 發布影片和電視直播內容,包括資料模型和整合步驟。

MovieEntity 資料模型

MovieEntity 代表完整版電影。下表摘要說明主要欄位。

公用方法 類型 規定 說明
getName() String 必填 電影名稱 (例如「復仇者聯盟:終局之戰」)
getDescription() 字串 必填 懸停時顯示的背景資訊摘要
getPosterImages() List<Image> 必填 用於顯示電影海報的圖片清單
getPlatformSpecificPlaybackUris() List<PlatformSpecificUri> 必填 在特定平台上播放的深層連結
getDurationMillis() 必填 電影的總時間長度 (以毫秒為單位)
getCallToActionText() 字串 必要 (GTV) 顯示的文字,用於提示使用者互動 (例如「立即觀看」)
getTags() List<String> 選用 用於分類的關鍵字 (例如「動作/驚悚」)

LiveTvProgramEntity 資料模型

LiveTvProgramEntity 代表特定頻道正在或預計播出的節目。

公用方法 類型 規定 說明
getName() String 必填 節目名稱 (例如「NBC CT Late News」)
getDescription() 字串 必填 提供計畫背景資訊的摘要
getPosterImages() List<Image> 必填 用於顯示節目的圖片
getAvailabilityTimeWindows() List<DisplayTimeWindow> 必填 節目的預定時間範圍
getChannelId() 字串 必填 電視頻道的專屬 ID
getChannelName() 字串 必填 電視頻道名稱
getChannelLogoImage() 圖片 必填 電視頻道標誌圖片
getCallToActionText() 字串 必要 (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)
    .setCallToActionText("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())
    .setCallToActionText("Watch Now")
    .addTag("News")
    .build();

API

publishRecommendationClusters() 會用於將候選內容傳送至精選輪播。叢集類型應設為 RecommendationClusterType.TYPE_PROVIDER_ROW

商品限制和指定目標

  • 項目限制:精選輪播最多可顯示 3 個項目。
  • 指定目標:你可以為每部裝置自訂精選輪播內容。由於內容是從裝置上安裝的用戶端應用程式發布,因此您可以為每位使用者或裝置填入專屬的個人化候選清單。不過,您必須負責實作這項指定目標邏輯,因為 Engage SDK 不提供內建的指定目標支援。

Engage SDK 版本

請注意,這項整合作業需要 Engage SDK 的最低版本:

engage-tv: 1.0.6