From b73eb7e13621448bf1dad99744da76f42a86681a Mon Sep 17 00:00:00 2001 From: Andrey Freitas Date: Tue, 13 Jun 2023 11:37:47 -0300 Subject: [PATCH] docs(dash): add section to readme on how to use DASH as MediaType closes #58 --- README.md | 39 ++++++++++++++++++++++++++++++--------- 1 file changed, 30 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 54193c49..cef71ddf 100644 --- a/README.md +++ b/README.md @@ -5,15 +5,17 @@ Enhanced Video Player for Android built on top of Exoplayer compliant with Andro ## Table of Contents -- [Table of Contents](#table-of-contents) -- [Setup](#setup) - - [Pre-requirements](#pre-requirements) - - [Install Node](#install-node) - - [Install Ruby Dependencies](#install-ruby-dependencies) - - [Install JS Dependencies](#install-js-dependencies) - - [Install Ktlint to IDE](#install-ktlint-to-ide) -- [Running the project](#running-the-project) -- [Documentation](#documentation) + - [Table of Contents](#table-of-contents) + - [Setup](#setup) + - [Pre-requirements](#pre-requirements) + - [Install Node](#install-node) + - [Install Ruby Dependencies](#install-ruby-dependencies) + - [Install JS Dependencies](#install-js-dependencies) + - [Install Ktlint to IDE](#install-ktlint-to-ide) + - [Running the project](#running-the-project) + - [Media Types](#media-types) + - [DASH](#dash) + - [Documentation](#documentation) ## Setup @@ -97,6 +99,25 @@ EnhancedVideoPlayer( ) ``` +### DASH + +Add the following module to the app's `build.gradle` + +```groovy +implementation "androidx.media3:media3-exoplayer-dash:$mediaVersion" +``` + +When creating the `MediaItem` you can simply pass the URI if it ends with `.mpd` or you can pass `MimeTypes.APPLICATION_MPD` to `setMimeType` of `MediaItem.Builder` + +```kotlin +val mediaItem = MediaItem.Builder() + .setMimeType(MimeTypes.APPLICATION_MPD) + .setUri(SOME_URI) + .build() + +EnhancedVideoPlayer(mediaItem = mediaItem) +``` + ## Documentation - [Releasing](docs/RELEASING.md)