สร้างบริการอินพุตทีวี
จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
การดูรายการทีวีสดและเนื้อหาอื่นๆ ที่ออกอากาศอย่างต่อเนื่องตามช่องเป็นส่วนสำคัญของประสบการณ์การรับชมทีวี ผู้ใช้คุ้นเคยกับการเลือกและดูรายการทีวีด้วยการเรียกดูช่อง TV Input Framework จะสร้างช่องทางสำหรับเผยแพร่เนื้อหาวิดีโอหรือเพลงในคู่มือการจัดโปรแกรมทีวี
ข้อควรระวัง: TV Input Framework มีไว้สำหรับ OEM เพื่อสร้างแชแนลสำหรับแอปทีวีของระบบ Android โดยรองรับใน Android 5.0 (API ระดับ 21) ถึง Android 7.1 (API ระดับ 25) เท่านั้น แอปของบุคคลที่สามควรสร้างช่องสำหรับเนื้อหาโดยใช้ API หน้าจอหลักของ Android TV ดูรายละเอียดได้ที่ แนะนำเนื้อหาบนหน้าจอหลัก
เฟรมเวิร์กอินพุตทีวีมีวิธีการแบบรวมสำหรับการรับและเล่นเนื้อหาวิดีโอสดจากแหล่งที่มาของฮาร์ดแวร์ เช่น พอร์ต HDMI และตัวรับสัญญาณในตัว และแหล่งที่มาของซอฟต์แวร์ เช่น วิดีโอที่สตรีมผ่านอินเทอร์เน็ต
เฟรมเวิร์กนี้ช่วยให้นักพัฒนาแอปกำหนดแหล่งที่มาของอินพุตรายการทีวีสดได้โดยใช้บริการอินพุตทีวี
บริการนี้จะเผยแพร่รายการช่องและรายการต่างๆ ไปยังผู้ให้บริการทีวี แอปทีวีสดบนอุปกรณ์ทีวีจะรับรายการช่องและรายการที่พร้อมให้รับชมจากผู้ให้บริการทีวี แล้วแสดงรายการเหล่านั้นต่อผู้ใช้
เมื่อผู้ใช้เลือกช่องที่ต้องการ แอปทีวีสดจะสร้างเซสชันสำหรับบริการอินพุตทีวีที่เกี่ยวข้องผ่านเครื่องมือจัดการอินพุตทีวี และบอกบริการอินพุตทีวีให้ปรับช่องเป็นช่องที่ขอและเล่นเนื้อหาบนแพลตฟอร์มการแสดงผลที่แอปทีวีให้
รูปที่ 1 แผนภาพการทำงานของเฟรมเวิร์กอินพุตทีวี
เฟรมเวิร์กอินพุตทีวีออกแบบมาเพื่อให้เข้าถึงแหล่งที่มาของอินพุตทีวีสดที่หลากหลาย และรวบรวมแหล่งที่มาเหล่านั้นไว้ในอินเทอร์เฟซผู้ใช้เดียวที่ผู้ใช้สามารถเรียกดู ดู และเพลิดเพลินกับเนื้อหา
การสร้างบริการอินพุตทีวีสำหรับเนื้อหาของคุณจะช่วยให้เนื้อหาเข้าถึงได้ง่ายขึ้นบนอุปกรณ์ทีวี
ดูรายละเอียดเพิ่มเติมได้ที่แอปตัวอย่าง
บริการอินพุตทีวี
หัวข้อ
- พัฒนาบริการอินพุตทีวี
- ดูวิธีพัฒนาบริการอินพุตทีวีที่ทำงานร่วมกับแอปทีวีของระบบ
- ทำงานกับข้อมูลช่อง
- ดูวิธีอธิบายข้อมูลช่องและโปรแกรมสำหรับระบบ
- จัดการการโต้ตอบของผู้ใช้ทีวี
- ดูวิธีแสดงการวางซ้อน จัดการความพร้อมใช้งานของเนื้อหา และจัดการการเลือกเนื้อหา
- รองรับการเลื่อนเวลา
- ดูวิธีรองรับการเลื่อนเวลาในบริการอินพุตทีวี
- รองรับการบันทึกเนื้อหา
- ดูวิธีรองรับการบันทึกเนื้อหาในบริการอินพุตทีวี
ตัวอย่างเนื้อหาและโค้ดในหน้าเว็บนี้ขึ้นอยู่กับใบอนุญาตที่อธิบายไว้ในใบอนุญาตการใช้เนื้อหา Java และ OpenJDK เป็นเครื่องหมายการค้าหรือเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2025-07-27 UTC
[null,null,["อัปเดตล่าสุด 2025-07-27 UTC"],[],[],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."]]