打造電視輸入服務
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
觀看直播電視節目和其他連續的頻道內容,是電視體驗的重要一環。使用者習慣在電視瀏覽頻道時,自行選擇並觀看節目。電視輸入架構會建立頻道,以發布電視節目指南中的影片或音樂內容。
注意:原始設備製造商 (OEM) 可利用電視輸入架構為 Android 系統電視應用程式建立頻道,但僅適用於 Android 5.0 (API 級別 21) 至 Android 7.1 (API 級別 25) 版本。第三方應用程式應使用 Android TV 主畫面 API 為內容建構頻道。詳情請參閱「 在主畫面上推薦內容」一文。
電視輸入架構提供一種整合式方法,可接收和播放來自硬體來源 (例如 HDMI 連接埠和內建調音器) 的即時影片內容,以及軟體來源 (例如透過網際網路串流播放的視訊)。
此架構可讓開發人員實作電視輸入服務,藉此定義電視直播輸入來源。這項服務會將頻道和節目清單發布至電視供應商。電視裝置上的電視直播應用程式會取得電視供應商提供的可用頻道和節目清單,並向使用者顯示。
使用者選取特定頻道時,電視輸入應用程式會透過電視輸入管理工具為相關的電視輸入服務建立工作階段,並指示電視輸入服務微調要求的頻道,並將內容播放至電視應用程式提供的顯示途徑。
圖 1 電視輸入架構的功能圖表。
電視輸入架構旨在提供不同的直播電視輸入來源,並整合到單一使用者介面,方便使用者瀏覽、觀看及享受內容。依據內容打造電視輸入服務,有助於觀眾在電視裝置上更順暢地存取內容。
詳情請參閱「
TV 輸入服務」範例應用程式。
Topics
- 開發電視輸入服務
- 瞭解如何開發與系統電視應用程式搭配使用的電視輸入服務。
- 使用頻道資料
- 瞭解如何描述系統的頻道和計畫資料。
- 管理電視使用者互動情形
- 瞭解如何顯示重疊元素、管理內容供應情況,以及處理內容選項。
- 支援影片播放操作
- 瞭解如何支援電視輸入服務的時間轉移功能。
- 支援內容錄製
- 瞭解如何支援電視輸入服務中的內容錄製功能。
這個頁面中的內容和程式碼範例均受《內容授權》中的授權所規範。Java 與 OpenJDK 是 Oracle 和/或其關係企業的商標或註冊商標。
上次更新時間:2025-07-27 (世界標準時間)。
[null,null,["上次更新時間:2025-07-27 (世界標準時間)。"],[],[],null,["# Build TV input services\n\nWatching live TV shows and other continuous, channel-based content is a big part of the TV\nexperience. Users are accustomed to selecting and watching shows on TV by channel browsing. The TV\nInput Framework creates channels for publishing video or music content in the TV programming\nguide.\n\n**Caution:** The TV Input Framework is meant to be used by OEMs to build\nchannels for the Android system TV app. It is supported in Android 5.0 (API level 21) through\nAndroid 7.1 (API level 25) only. Third-party apps should build channels for their content using\nthe Android TV home screen APIs. See [Recommend\ncontent on the home screen](/training/tv/discovery/recommendations) for details.\n\nThe TV Input Framework provides a unified method for the receiving and playback of live video content\nfrom hardware sources, such as HDMI ports and built-in-tuners, and software sources, such as video\nstreamed over the internet.\n\nThe\nframework lets developers define live TV input sources by implementing a TV input service.\nThis service publishes a list of channels and programs to the TV Provider. The live TV app on a TV\ndevice gets the list of available channels and programs from the TV Provider and displays them to a\nuser.\n\n\nWhen a user selects a specific channel, the live TV app creates a session for the associated\nTV input service through the TV Input Manager and tells the TV input service to tune to the\nrequested channel and play the content to a display surface provided by the TV app.\n\n\n**Figure 1.** Functional diagram of the TV Input Framework.\n\n\nThe TV Input Framework is designed to provide access to a wide variety of live TV input sources\nand bring them together in a single user interface where users can browse, view, and enjoy content.\nBuilding a TV input service for your content can help make it more accessible on TV devices.\n\n\nFor more details, check out the [TV Input Service](https://github.com/googlesamples/androidtv-sample-inputs) sample app.\n\nTopics\n------\n\n**[Develop a TV input service](/training/tv/tif/tvinput)**\n: Learn how to develop a TV input service that works with the system TV app.\n\n**[Work with channel data](/training/tv/tif/channel)**\n: Learn how to describe channel and program data for the system.\n\n**[Manage TV user interaction](/training/tv/tif/ui)**\n: Learn how to present overlays, manage content availability, and handle content selection.\n\n**[Support time-shifting](/training/tv/tif/time-shifting)**\n: Learn how to support time-shifting in your TV input service.\n\n**[Support content recording](/training/tv/tif/content-recording)**\n: Learn how to support content recording in your TV input service."]]