媒体显示和播放简介
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
媒体显示和播放已成为 Android 应用体验中不可或缺的组成部分。无论您的应用是集成图片和视频,还是提供身临其境的音频体验,媒体都能丰富用户互动并提升应用互动度。
Android 会不断改进 API,以最大限度地简化媒体集成的复杂性,同时使用户体验更加集成和一致。本页面提供了一些资源,可帮助您上手使用这些 API,并提升应用的功能。
了解重要的 Android 媒体 API 和概念
Android 提供了可在不同级别运行的 API,可让您的应用充分利用可用的硬件和软件功能。
显示图片
高效加载画质最高的图片是打造应用中流畅用户体验的关键。以下资源可为您提供帮助:
播放和流式传输音频和视频
Jetpack Media3 提供无缝媒体播放、媒体浏览和高效资源管理等高级功能。了解详情:
提升应用的竞争力
您希望自己的应用支持符合并超越用户预期的功能。实现这一点的方法之一是支持高级设备提供的高级媒体功能。以下是一些有助于您的应用脱颖而出的实用方法:
请参阅完整指南,了解可提升媒体显示和播放体验并给用户留下深刻印象的功能。
本页面上的内容和代码示例受内容许可部分所述许可的限制。Java 和 OpenJDK 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-03-26。
[null,null,["最后更新时间 (UTC):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."]]