앱의 활동은 시스템 UX 제한으로 인해 숨겨지므로 운전 중에도 오디오 재생을 계속하려면 앱에서 백그라운드 재생을 지원해야 합니다. Media3 라이브러리를 사용하여 이를 실행하는 방법에 관한 자세한 내용은 MediaSessionService를 사용한 백그라운드 재생을 참고하세요.
앱은 앱의 MediaSession가 포함된 MediaStyle 알림을 게시해야 합니다. MediaSessionService를 사용하는 경우 기본적으로 자동으로 처리됩니다.
이 페이지에 나와 있는 콘텐츠와 코드 샘플에는 콘텐츠 라이선스에서 설명하는 라이선스가 적용됩니다. 자바 및 OpenJDK는 Oracle 및 Oracle 계열사의 상표 또는 등록 상표입니다.
최종 업데이트: 2025-07-27(UTC)
[null,null,["최종 업데이트: 2025-07-27(UTC)"],[],[],null,["# Build video apps for Android Automotive OS\n\nIn addition to the guidelines described in [Build parked apps for Android\nAutomotive OS](/training/cars/parked/automotive-os), there are some requirements specific to video apps.\n| **Design guidelines:** Refer to [Adapt video apps](https://developers.google.com/cars/design/create-apps/parked-passenger-apps/overview) for UX guidance specific to video apps.\n| **Important:** Google takes driver distraction very seriously. Your app must meet specific criteria before it can be listed on Google Play for Android Automotive OS. By adhering to these requirements, you can make it easier to build and test your app. For more information, see [Android app quality for cars](/docs/quality-guidelines/car-app-quality?category=video).\n\nMark your app as a video app\n----------------------------\n\nTo indicate that your app supports video, add an XML file\nnamed `automotive_app_desc.xml` to the `res/xml/` directory in your project.\nIn this file, include the following content: \n\n \u003cautomotiveApp\u003e\n \u003cuses name=\"video\"/\u003e\n \u003c/automotiveApp\u003e\n\n| **Note:** You might see a lint error in Android Studio that says \"Expecting one of `media`, `notification`, `sms`, or `template` for the name attribute in uses tag.\" This can be safely ignored by adding `tools:ignore=\"InvalidUsesTagAttribute\"` to the `\u003cuses\u003e` element.\n\nThen, within the [`\u003capplication\u003e`](/guide/topics/manifest/application-element) element of your manifest, add the\nfollowing [`\u003cmeta-data\u003e`](/guide/topics/manifest/meta-data-element) element referencing the XML file: \n\n \u003cmeta-data\n android:name=\"com.android.automotive\"\n android:resource=\"@xml/automotive_app_desc\"/\u003e\n\nSupport audio while driving\n---------------------------\n\nAudio while driving is a beta feature \nPublishing apps that support audio while driving is limited to early access partners. While this feature is in beta, you can prepare your app for support by following the guidance in this section. \n[Nominate yourself to be an early access partner →](https://goo.gle/440dHqw) \n\nIn general, all video apps must pause playback when user experience restrictions\nare active, as described in [Meet driver distraction requirements](/training/cars/parked/automotive-os#driver-distraction).\n\nHowever, some vehicles have the ability to display driving-optimized playback\ncontrols while user experience restrictions are active, making it possible to\ncontinue playing audio.\n**Figure 1**: Driving optimized playback controls for an app that supports audio while driving. \n[Codelab\nFollow a step-by-step guide to implement support for audio while driving\narrow_forward](/codelabs/audio-while-driving)\n\n### Declare that your app supports audio while driving\n\nTo indicate that your app supports audio while driving, add the following\n[`\u003cuses-feature\u003e`](/guide/topics/manifest/uses-feature-element) element in your manifest: \n\n \u003capplication ...\u003e\n ...\n \u003cuses-feature android:name=\"com.android.car.background_audio_while_driving\" android:required=\"false\"\u003e\n ....\n \u003c/application\u003e\n\n| **Important:** Setting the `android:required` attribute to `false` ensures that your app can still be distributed to devices that don't support audio while driving.\n\n### Support background playback\n\nBecause your app's activities are hidden by the system UX restrictions, your app\nmust support background playback to continue playing audio while driving. See\n[Background playback with a MediaSessionService](/media/media3/session/background-playback) for details on how to\naccomplish this using the Media3 library.\n\nYour app must post a [`MediaStyle`](/reference/androidx/media/app/NotificationCompat.MediaStyle) notification that includes your app's\n`MediaSession`. If you're using `MediaSessionService`, this is [handled for you\nby default](/media/media3/session/background-playback#notification).\n| **Caution:** If you don't use a service for background playback, playback may continue for a short period of time, but your app will eventually be [cached](/guide/components/activities/process-lifecycle) by the system, causing playback to end.\n\n### Determine support\n\nTo determine if a device supports audio while driving, you can use the\n[`CarFeatures`](/reference/androidx/car/app/features/CarFeatures#summary) class from the [`androidx.car.app:app`](/jetpack/androidx/releases/car-app) library. \n\n CarFeatures.isFeatureEnabled(context, CarFeatures.FEATURE_BACKGROUND_AUDIO_WHILE_DRIVING)\n\nUse this information to modify your app's behavior depending on the capabilities\nof the device it's running on. On devices that don't support audio while\ndriving, your app must still meet the [`DD-2`](/docs/quality-guidelines/car-app-quality?category=video#DD-2) guideline.\n\n### Test audio while driving\n\nTo test your implementation, you can [simulate driving](/training/cars/testing/emulator#simulate-driving) can using an\n[emulator image that supports audio while driving](/training/cars/testing/emulator?filter=audio-while-driving#generic-images).\n| **Caution:** Be sure to test that your app still meets the [`DD-2`](/docs/quality-guidelines/car-app-quality?category=video#DD-2) guideline on devices that don't support audio while driving.\n\nFrequently asked questions\n--------------------------\n\n### Is Widevine DRM supported?\n\nYes, Widevine DRM L3 is supported on Android Automotive OS."]]