關於媒體顯示和播放
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
媒體顯示和播放功能已成為 Android 應用程式體驗的重要元素。無論是整合圖片和影片,還是提供身歷其境的音訊體驗,媒體都能豐富使用者互動,提升應用程式參與度。
Android 會持續改進 API,盡可能簡化整合媒體的複雜度,同時讓使用者體驗更整合、更一致。本頁面提供的資源可協助您開始使用,並提升應用程式的功能。
瞭解重要的 Android 媒體 API 和概念
Android 提供的 API 可在不同層級運作,讓應用程式充分運用可用的硬體和軟體功能。
顯示圖片
有效載入最高品質的圖片,是打造順暢應用程式使用者體驗的關鍵。以下提供一些有用的資源:
播放及串流音訊和視訊
Jetpack Media3 提供順暢的媒體播放、媒體瀏覽和高效的資源管理等進階功能。瞭解詳情:
提升應用程式
您希望應用程式支援的功能能滿足使用者期待,甚至超越使用者期待。其中一種方法是支援高級裝置提供的進階媒體功能。以下是讓應用程式脫穎而出的具體做法:
請參閱完整指南,瞭解可提升媒體顯示和播放體驗,並讓使用者留下深刻印象的功能。
這個頁面中的內容和程式碼範例均受《內容授權》中的授權所規範。Java 與 OpenJDK 是 Oracle 和/或其關係企業的商標或註冊商標。
上次更新時間:2025-03-26 (世界標準時間)。
[null,null,["上次更新時間:2025-03-26 (世界標準時間)。"],[],[],null,["# About media display and playback\n\nMedia display and playback have become essential components of the Android app\nexperience. Whether your app integrates images and videos or delivers immersive\naudio experiences, media enriches user interactions and elevates app engagement.\n\nAndroid continues to evolve APIs to minimize the complexity of integrating media\nwhile making the user experience more integrated and consistent, and this page\nconnects you to resources to both help you get started and level up your app.\n\nKnow key Android media APIs and concepts\n----------------------------------------\n\nAndroid has APIs that work at different levels to allow your app to make the\nmost of the available hardware and software features.\n\n### Display images\n\nLoading the highest-quality images efficiently is key to building a smooth user\nexperience in your app. Here are some resources that will help:\n\n- [Loading images from local resources](/develop/ui/compose/graphics/images/loading)\n- [Loading images from a remote server](/develop/ui/compose/graphics/images/loading#internet-loading)\n- [Loading Large Bitmaps Efficiently](/topic/performance/graphics/load-bitmap)\n- [Displaying images in UltraHDR](/media/grow/ultra-hdr/display)\n\n### Playback and stream audio and video\n\n[Jetpack Media3](/media/media3) offers advanced features such as seamless media playback,\nmedia browsing, and efficient resource management. Learn more:\n\n- [Live-streaming](/media/media3/exoplayer/live-streaming)\n- [Downloading media](/media/media3/exoplayer/downloading-media)\n- [Playback controls and player UI](/media/media3/ui/overview)\n- [Background playback](/media/media3/session/background-playback)\n\nLevel up your app\n-----------------\n\nYou'll want your app to support features that meet and surpass user\nexpectations. One way to do that is to support the advanced media features\nprovided by premium devices. Here are some specific ways to help your app stand\nout:\n\n- Support [UltraHDR](/media/grow/ultra-hdr-display) images and [HDR](/media/grow/hdr-playback) video\n- Enable [picture-in-picture](/develop/ui/views/picture-in-picture) for video and audio playback\n- Implement [Cast Connect](https://developers.google.com/cast/docs/android_tv_receiver) so users can cast to your native Android TV app\n- Use [Performance Class](/topic/performance/performance-class) to adapt your user experience around device capabilities\n\nSee the [full guide](/social-and-messaging/guides/media-display/basic-better-best) for features to consider to take your media display and\nplayback experience to the next level and impress your users."]]