https://github.com/profusion/android-enhanced-video-player
Enhanced Video Player for Android built on top of Exoplayer compliant with Jetpack
https://github.com/profusion/android-enhanced-video-player
android exoplayer jetpack-compose player video-player
Last synced: 11 months ago
JSON representation
Enhanced Video Player for Android built on top of Exoplayer compliant with Jetpack
- Host: GitHub
- URL: https://github.com/profusion/android-enhanced-video-player
- Owner: profusion
- License: mit
- Created: 2023-05-22T17:56:15.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2024-04-08T20:21:50.000Z (about 2 years ago)
- Last Synced: 2025-05-29T18:14:15.302Z (about 1 year ago)
- Topics: android, exoplayer, jetpack-compose, player, video-player
- Language: Kotlin
- Homepage: https://jitpack.io/#profusion/android-enhanced-video-player
- Size: 2.12 MB
- Stars: 7
- Watchers: 17
- Forks: 0
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- Contributing: docs/CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
# android-enhanced-video-player
[](https://jitpack.io/#profusion/android-enhanced-video-player)
[](https://github.com/profusion/android-enhanced-video-player/actions/workflows/android-jetpack.yml)
Enhanced Video Player for Android built on top of Exoplayer compliant with Android Jetpack Compose
## Table of Contents
- [Table of Contents](#table-of-contents)
- [Installation](#installation)
- [Media Types](#media-types)
- [HLS](#hls)
- [DASH](#dash)
- [MSS/SmoothStreaming](#msssmoothstreaming)
- [Documentation](#documentation)
## Installation
1. Add it in your root build.gradle at the end of repositories:
```groovy
allprojects {
repositories {
...
maven { url 'https://jitpack.io' }
}
}
```
2. Add the dependency
```groovy
dependencies {
implementation 'com.github.profusion:android-enhanced-video-player:Tag'
}
```
## Media Types
Exoplayer supports the three main adaptive streaming algorithms: HLS, DASH and MSS.
However, this project does not add the modules responsible for that in the library
module so we can lower the size of the distributed package.
Any apps that import `EnhancedVideoPlayer` can still play URIs from adaptive
streaming algorithms. To do that, one can import the necessary module's on the
app's `build.gradle` as described below.
### HLS
Add the following module to the app's `build.gradle`
```groovy
implementation "androidx.media3:media3-exoplayer-hls:$mediaVersion"
```
When creating the `MediaItem`, simply pass the HLS URI
```kotlin
EnhancedVideoPlayer(
mediaItem = MediaItem.fromUri(
"https://demo-streaming.gcdn.co/videos/676_YJHUNNocCsrjiCDx/master.m3u8"
)
)
```
### 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)
```
### MSS/SmoothStreaming
Add the following module to the app's `build.gradle`
```groovy
implementation "androidx.media3:media3-exoplayer-smoothstreaming:$mediaVersion"
```
When creating the `MediaItem` you can simply pass the URI if it ends with `.ism/Manifest` or
you can pass `MimeTypes.APPLICATION_SS` to `setMimeType` of `MediaItem.Builder`
```kotlin
val mediaItem = MediaItem.Builder()
.setMimeType(MimeTypes.APPLICATION_SS)
.setUri(SOME_URI)
.build()
EnhancedVideoPlayer(mediaItem = mediaItem)
```
## Documentation
- [Contributing](docs/CONTRIBUTING.md)
- [Integrating with React Native](docs/react-native.md)
- [Releasing](docs/RELEASING.md)