DASH
컬렉션을 사용해 정리하기
내 환경설정을 기준으로 콘텐츠를 저장하고 분류하세요.
ExoPlayer는 여러 컨테이너 형식으로 DASH를 지원합니다. 미디어 스트림은 디멀티플렉싱되어야 합니다. 즉, 동영상, 오디오, 텍스트는 DASH 매니페스트의 별도 AdaptationSet
요소에 정의되어야 합니다 (CEA-608은 아래 표에 설명된 대로 예외임). 포함된 오디오 및 동영상 샘플 형식도 지원되어야 합니다 (자세한 내용은 샘플 형식 섹션 참고).
기능 |
지원됨 |
비고 |
컨테이너 |
|
|
FMP4 |
예 |
디멀티플렉싱된 스트림만 |
WebM |
예 |
디멀티플렉싱된 스트림만 |
Matroska |
예 |
디멀티플렉싱된 스트림만 |
MPEG-TS |
아니요 |
지원 계획 없음 |
자막 |
|
|
TTML
|
예
|
ISO/IEC 14496-30에 따라 원시 또는 FMP4에 삽입 |
WebVTT
|
예
|
ISO/IEC 14496-30에 따라 원시 또는 FMP4에 삽입 |
CEA-608
|
예
|
SCTE 접근성 설명자를 사용하여 신호가 전송될 때 FMP4에 삽입됨 |
CEA-708
|
예
|
SCTE 접근성 설명자를 사용하여 신호가 전송될 때 FMP4에 삽입됨 |
메타데이터 |
|
|
EMSG 메타데이터 |
예 |
FMP4에 삽입됨 |
콘텐츠 보호 |
|
|
Widevine
|
예
|
'cenc' 스킴: API 19 이상
'cbcs' 스킴: API 25 이상 |
PlayReady SL2000 |
예 |
Android TV, 'cenc' 스키마만 |
ClearKey |
예 |
API 21 이상, 'cenc' 스킴만 |
광고 삽입 |
|
|
다중 기간 재생 |
예 |
|
서버 안내 광고 삽입(xlinks) |
아니요
|
|
IMA 서버 측 및 클라이언트 측 광고 |
예
|
광고 삽입 가이드
|
라이브 재생 |
|
|
일반 라이브 재생 |
예 |
|
매우 짧은 지연 시간 CMAF 라이브 재생 |
예
|
|
Common Media Client Data
(CMCD) |
예
|
CMCD 통합 가이드
|
DASH 스트림을 재생하려면 DASH 모듈에 종속되어야 합니다.
Kotlin
implementation("androidx.media3:media3-exoplayer-dash:1.8.0")
Groovy
implementation "androidx.media3:media3-exoplayer-dash:1.8.0"
그런 다음 DASH MPD URI의 MediaItem
를 만들어 플레이어에 전달할 수 있습니다.
Kotlin
// Create a player instance.
val player = ExoPlayer.Builder(context).build()
// Set the media item to be played.
player.setMediaItem(MediaItem.fromUri(dashUri))
// Prepare the player.
player.prepare()
자바
// Create a player instance.
ExoPlayer player = new ExoPlayer.Builder(context).build();
// Set the media item to be played.
player.setMediaItem(MediaItem.fromUri(dashUri));
// Prepare the player.
player.prepare();
URI가 .mpd
로 끝나지 않으면 MediaItem.Builder
의 setMimeType
에 MimeTypes.APPLICATION_MPD
를 전달하여 콘텐츠 유형을 명시적으로 나타낼 수 있습니다.
ExoPlayer는 사용 가능한 대역폭과 기기 기능을 모두 고려하여 매니페스트에 정의된 표현 간에 자동으로 적응합니다.
더 많은 맞춤설정 옵션을 사용하려면 MediaItem
대신 DashMediaSource
를 만들어 플레이어에 직접 전달하면 됩니다.
Kotlin
val dataSourceFactory: DataSource.Factory = DefaultHttpDataSource.Factory()
// Create a dash media source pointing to a dash manifest uri.
val mediaSource: MediaSource =
DashMediaSource.Factory(dataSourceFactory).createMediaSource(MediaItem.fromUri(dashUri))
// Create a player instance which gets an adaptive track selector by default.
val player = ExoPlayer.Builder(context).build()
// Set the media source to be played.
player.setMediaSource(mediaSource)
// Prepare the player.
player.prepare()
자바
DataSource.Factory dataSourceFactory = new DefaultHttpDataSource.Factory();
// Create a dash media source pointing to a dash manifest uri.
MediaSource mediaSource =
new DashMediaSource.Factory(dataSourceFactory)
.createMediaSource(MediaItem.fromUri(dashUri));
// Create a player instance which gets an adaptive track selector by default.
ExoPlayer player = new ExoPlayer.Builder(context).build();
// Set the media source to be played.
player.setMediaSource(mediaSource);
// Prepare the player.
player.prepare();
매니페스트 액세스
Player.getCurrentManifest
를 호출하여 현재 매니페스트를 가져올 수 있습니다.
DASH의 경우 반환된 객체를 DashManifest
로 캐스팅해야 합니다. 매니페스트가 로드될 때마다 Player.Listener
의 onTimelineChanged
콜백도 호출됩니다. 온디맨드 콘텐츠의 경우 한 번 발생하며 라이브 콘텐츠의 경우 여러 번 발생할 수 있습니다. 다음 코드 스니펫은 매니페스트가 로드될 때마다 앱이 작업을 실행하는 방법을 보여줍니다.
Kotlin
player.addListener(
object : Player.Listener {
override fun onTimelineChanged(timeline: Timeline, @TimelineChangeReason reason: Int) {
val manifest = player.currentManifest
if (manifest is DashManifest) {
// Do something with the manifest.
}
}
}
)
자바
player.addListener(
new Player.Listener() {
@Override
public void onTimelineChanged(
Timeline timeline, @Player.TimelineChangeReason int reason) {
Object manifest = player.getCurrentManifest();
if (manifest != null) {
DashManifest dashManifest = (DashManifest) manifest;
// Do something with the manifest.
}
}
});
재생 맞춤설정
ExoPlayer는 앱의 요구사항에 맞게 재생 환경을 맞춤설정할 수 있는 여러 방법을 제공합니다. 예는 맞춤설정 페이지를 참고하세요.
이 페이지에 나와 있는 콘텐츠와 코드 샘플에는 콘텐츠 라이선스에서 설명하는 라이선스가 적용됩니다. 자바 및 OpenJDK는 Oracle 및 Oracle 계열사의 상표 또는 등록 상표입니다.
최종 업데이트: 2025-08-27(UTC)
[null,null,["최종 업데이트: 2025-08-27(UTC)"],[],[],null,["# DASH\n\nExoPlayer supports DASH with multiple container formats. Media streams must be\ndemuxed, meaning that video, audio, and text must be defined in distinct\n`AdaptationSet` elements in the DASH manifest (CEA-608 is an exception as\ndescribed in the table below). The contained audio and video sample formats must\nalso be supported (see the\n[sample formats](/media/media3/exoplayer/supported-formats#sample-formats) section for details).\n\n| Feature | Supported | Comments |\n|-----------------------------------------|-----------|----------------------------------------------------------------------|\n| **Containers** | | |\n| FMP4 | YES | Demuxed streams only |\n| WebM | YES | Demuxed streams only |\n| Matroska | YES | Demuxed streams only |\n| MPEG-TS | NO | No support planned |\n| **Closed captions /** **subtitles** | | |\n| TTML | YES | Raw, or embedded in FMP4 according to ISO/IEC 14496-30 |\n| WebVTT | YES | Raw, or embedded in FMP4 according to ISO/IEC 14496-30 |\n| CEA-608 | YES | Embedded in FMP4 when signalled using SCTE Accessibility descriptors |\n| CEA-708 | YES | Embedded in FMP4 when signalled using SCTE Accessibility descriptors |\n| **Metadata** | | |\n| EMSG metadata | YES | Embedded in FMP4 |\n| **Content protection** | | |\n| Widevine | YES | \"cenc\" scheme: API 19+; \"cbcs\" scheme: API 25+ |\n| PlayReady SL2000 | YES | Android TV, \"cenc\" scheme only |\n| ClearKey | YES | API 21+, \"cenc\" scheme only |\n| **Ad insertion** | | |\n| Multi-period playback | YES | |\n| Server-guided ad insertion (xlinks) | NO | |\n| IMA server-side and client-side ads | YES | [Ad insertion guide](/media/media3/exoplayer/ad-insertion) |\n| **Live playback** | | |\n| Regular live playback | YES | |\n| Ultra low-latency CMAF live playback | YES | |\n| **Common Media Client Data** **(CMCD)** | YES | [CMCD integration guide](/media/media3/exoplayer/cmcd) |\n\nUsing MediaItem\n---------------\n\nTo play a DASH stream, you need to depend on the DASH module. \n\n### Kotlin\n\n```kotlin\nimplementation(\"androidx.media3:media3-exoplayer-dash:1.8.0\")\n```\n\n### Groovy\n\n```groovy\nimplementation \"androidx.media3:media3-exoplayer-dash:1.8.0\"\n```\n\nYou can then create a `MediaItem` for a DASH MPD URI and pass it to the player. \n\n### Kotlin\n\n```kotlin\n// Create a player instance.\nval player = ExoPlayer.Builder(context).build()\n// Set the media item to be played.\nplayer.setMediaItem(MediaItem.fromUri(dashUri))\n// Prepare the player.\nplayer.prepare()\n```\n\n### Java\n\n```java\n// Create a player instance.\nExoPlayer player = new ExoPlayer.Builder(context).build();\n// Set the media item to be played.\nplayer.setMediaItem(MediaItem.fromUri(dashUri));\n// Prepare the player.\nplayer.prepare();\n```\n\n\u003cbr /\u003e\n\nIf your URI doesn't end with `.mpd`, you can pass `MimeTypes.APPLICATION_MPD`\nto `setMimeType` of `MediaItem.Builder` to explicitly indicate the type of the\ncontent.\n\nExoPlayer will automatically adapt between representations defined in the\nmanifest, taking into account both available bandwidth and device capabilities.\n\nUsing DashMediaSource\n---------------------\n\nFor more customization options, you can create a `DashMediaSource` and pass it\ndirectly to the player instead of a `MediaItem`. \n\n### Kotlin\n\n```kotlin\nval dataSourceFactory: DataSource.Factory = DefaultHttpDataSource.Factory()\n// Create a dash media source pointing to a dash manifest uri.\nval mediaSource: MediaSource =\n DashMediaSource.Factory(dataSourceFactory).createMediaSource(MediaItem.fromUri(dashUri))\n// Create a player instance which gets an adaptive track selector by default.\nval player = ExoPlayer.Builder(context).build()\n// Set the media source to be played.\nplayer.setMediaSource(mediaSource)\n// Prepare the player.\nplayer.prepare()\n```\n\n### Java\n\n```java\nDataSource.Factory dataSourceFactory = new DefaultHttpDataSource.Factory();\n// Create a dash media source pointing to a dash manifest uri.\nMediaSource mediaSource =\n new DashMediaSource.Factory(dataSourceFactory)\n .createMediaSource(MediaItem.fromUri(dashUri));\n// Create a player instance which gets an adaptive track selector by default.\nExoPlayer player = new ExoPlayer.Builder(context).build();\n// Set the media source to be played.\nplayer.setMediaSource(mediaSource);\n// Prepare the player.\nplayer.prepare();\n```\n\n\u003cbr /\u003e\n\nAccessing the manifest\n----------------------\n\nYou can retrieve the current manifest by calling `Player.getCurrentManifest`.\nFor DASH you should cast the returned object to `DashManifest`. The\n`onTimelineChanged` callback of `Player.Listener` is also called whenever\nthe manifest is loaded. This will happen once for a on-demand content, and\npossibly many times for live content. The following code snippet shows how an app\ncan do something whenever the manifest is loaded. \n\n### Kotlin\n\n```kotlin\nplayer.addListener(\n object : Player.Listener {\n override fun onTimelineChanged(timeline: Timeline, @TimelineChangeReason reason: Int) {\n val manifest = player.currentManifest\n if (manifest is DashManifest) {\n // Do something with the manifest.\n }\n }\n }\n)\n```\n\n### Java\n\n```java\nplayer.addListener(\n new Player.Listener() {\n @Override\n public void onTimelineChanged(\n Timeline timeline, @Player.TimelineChangeReason int reason) {\n Object manifest = player.getCurrentManifest();\n if (manifest != null) {\n DashManifest dashManifest = (DashManifest) manifest;\n // Do something with the manifest.\n }\n }\n });\n```\n\n\u003cbr /\u003e\n\nCustomizing playback\n--------------------\n\nExoPlayer provides multiple ways for you to tailor playback experience to your\napp's needs. See the [Customization page](/guide/topics/media/exoplayer/customization) for examples."]]