기기 간 라우팅
컬렉션을 사용해 정리하기
내 환경설정을 기준으로 콘텐츠를 저장하고 분류하세요.
사용자는 무선 기술로 TV, 홈 씨어터 시스템 및 음악 플레이어를 연결할 때 크기와 소리가 큰 이런 기기에서 Android 앱의 콘텐츠를 재생하고자 할 수 있습니다. 이 같은 재생이 가능하면 한 대의 기기, 한 명의 사용자로 제한되던 앱이 여러 사용자를 기쁘게 하고 사로잡는 공유 환경으로 탈바꿈할 수 있습니다.
Android 미디어 라우터 API는 일반 사용자 인터페이스를 사용하여 원격 수신 기기에서 미디어 표시 및 재생이 가능하도록 설계되었습니다. 그러면 MediaRouter
인터페이스를 구현하는 앱 개발자가 프레임워크에 연결하고 미디어 라우터 프레임워크에 참여하는 기기에서 콘텐츠를 재생할 수 있습니다. 미디어 재생 기기 제조업체는 다른 애플리케이션에서 수신 기기에 연결하여 미디어를 재생할 수 있는 MediaRouteProvider
를 게시하여 프레임워크에 참여할 수 있습니다. 그림 1은 미디어 라우터 프레임워크를 통해 앱이 수신 기기에 연결되는 방법을 보여줍니다.
그림 1. 미디어 경로 제공자 클래스가 미디어 앱에서 수신 기기로 통신하는 방법 개요
참고: 앱에서 Google Cast 기기를 지원하려면 Cast SDK를 사용하여 Cast 전송기로 앱을 빌드해야 합니다. MediaRouter 프레임워크를 직접 사용하는 대신 Cast 문서의 안내를 따르세요.
MediaRouter 지원 라이브러리
mediarouter API는 AndroidX MediaRouter 라이브러리에 정의되어 있습니다.
이 라이브러리는 Android 2.3 (API 레벨 9) 이상을 실행하는 기기와 호환되고 모든 기기에 일관된 환경을 제공합니다.
mediarouter API에 관한 자세한 내용은 API 참조에서 androidx.mediarouter.media
패키지를 확인하세요.
- MediaRouter API
- 미디어 앱은
MediaRouter
API를 사용하여 사용 가능한 원격 재생 기기를 찾고 오디오와 동영상을 기기에 라우팅합니다.
- MediaRouteProvider API
MediaRouteProvider
API는 원격 재생 기기의 기능을 정의하고, MediaRouter
를 사용하여 대체 미디어 경로를 검색하는 앱에 기기가 표시되게 합니다.
출력 전환기

Android 11부터 앱의 라우팅 옵션도 시스템 미디어 플레이어에 표시됩니다. 이를 통해 사용자는 부엌에서 또는 휴대전화로 동영상을 시청하거나 집 또는 자동차에서 오디오를 듣는 등 시청 및 청취 환경을 변경하면서 기기 사이를 이동할 때 매끄럽게 이동할 수 있습니다.
미디어 알림에서 경로 선택 버튼을 누르면 기본적으로 다음 선택사항이 있는 출력 전환기가 표시됩니다.
- 현재 기기의 스피커
- 연결된 모든 블루투스 오디오 기기
앱은 기능(예: Cast)에 따라 더 많은 옵션을 제공할 수도 있습니다.
앱은 MediaRouter
API를 사용하여 라우팅 선택을 맞춤설정할 수 있습니다. 지원하지 않는 기기를 제외하거나 (Netflix 스마트 TV를 시청한다면 오디오 전용 Chromecast를 필터링) 앱에서 인식하는 다른 특수 기기를 포함할 수 있습니다.
이 페이지에 나와 있는 콘텐츠와 코드 샘플에는 콘텐츠 라이선스에서 설명하는 라이선스가 적용됩니다. 자바 및 OpenJDK는 Oracle 및 Oracle 계열사의 상표 또는 등록 상표입니다.
최종 업데이트: 2025-08-27(UTC)
[null,null,["최종 업데이트: 2025-08-27(UTC)"],[],[],null,["# Routing between devices\n\nAs users connect their televisions, home theater systems, and music players with wireless\ntechnologies, they want to be able to play content from Android apps on these larger,\nlouder devices. Enabling this kind of playback can turn your one-device, one-user app\ninto a shared experience that delights and inspires multiple users.\n\n\u003cbr /\u003e\n\nThe Android media router APIs are designed to enable media display and playback on\nremote receiver devices using a common user interface. App developers that\nimplement a [MediaRouter](/reference/androidx/mediarouter/media/MediaRouter) interface can then connect to the\nframework and play content to devices that participate in the media router framework. Media\nplayback device manufacturers can participate in the framework by publishing a [MediaRouteProvider](/reference/androidx/mediarouter/media/MediaRouteProvider) that allows other applications to connect to and\nplay media on the receiver devices. Figure 1 illustrates how an app connects to a receiver\ndevice through the media router framework.\n\n\u003cbr /\u003e\n\n\n**Figure 1.** Overview of how media route provider classes provide communication\nfrom a media app to a receiver device.\n\n\u003cbr /\u003e\n\n\n**Note:** If you want your app to support\n[Google Cast](https://developers.google.com/cast/) devices,\nyou should use the [Cast SDK](https://developers.google.com/cast/docs/reference/)\nand build your app as a Cast sender. Follow the directions in the\n[Cast documentation](https://developers.google.com/cast/docs/android_sender_setup)\ninstead of using the MediaRouter framework directly.\n\nMediaRouter support library\n---------------------------\n\nThe mediarouter APIs are defined in the\n[AndroidX MediaRouter library](/guide/topics/media/mediarouter).\nThis library is compatible with devices running Android 2.3 (API level 9) and higher and ensures a consistent\nexperience across all of them.\nFor detailed information about the mediarouter APIs, see the [androidx.mediarouter.media](/reference/androidx/mediarouter/media/package-summary)\npackage in the API reference.\n\n**[MediaRouter API](/guide/topics/media/mediarouter)**\n: A media app uses the `MediaRouter` API to discover available remote playback devices and to route audio and video to them.\n\n**[MediaRouteProvider API](/guide/topics/media/mediarouteprovider)**\n: The `MediaRouteProvider` API defines the capabilities of a remote playback device and makes it visible to apps that use a `MediaRouter` to search for alternative media paths.\n\nThe output switcher\n-------------------\n\nStarting with Android 11, your app's routing\noptions also appear in the system media player. This helps to give the user a\nseamless journey when moving between devices as they change their viewing and\nlistening contexts, such as watching video in the kitchen versus on a phone,\nor listening to audio in the home or car.\n\nPressing the route selection button in a media notification brings up the\noutput switcher with these choices by default:\n\n- The speaker on the current device\n- All connected Bluetooth audio devices\n\nApps can also provide more options depending on their capabilities, such as Cast.\n\nApps can use the [`MediaRouter`](/reference/androidx/mediarouter/media/MediaRouter)\nAPI to customize\nthe routing choices. You can exclude devices you don't support (like filtering\nout audio-only Chromecast if you're watching a Netflix smart TV) or include\nother special devices that your app recognizes."]]