Skip to content

Latest commit

 

History

History
78 lines (51 loc) · 1.78 KB

File metadata and controls

78 lines (51 loc) · 1.78 KB

mpvlib Android

Android library based on libmpv for video playback and thumbnail generation.

Overview

This library provides Android bindings for the mpv media player, allowing developers to integrate mpv's powerful video playback capabilities and thumbnail generation into their Android applications.

Features

  • Full mpv media player integration
  • Video thumbnail generation
  • Support for multiple ABIs: armeabi-v7a, arm64-v8a, x86, x86_64
  • Kotlin-friendly API

Requirements

  • Android 5.0 (API level 21) or higher
  • Android Studio with Gradle support

Installation

Just one simple step:

  1. Download the pre-built AAR from the releases page
  2. Create a libs directory in your app module if it doesn't exist
  3. Copy the AAR file (e.g., mpv-android-lib-v0.0.1.aar) to the libs directory
  4. Add this single line to your module-level build.gradle:
dependencies {
    implementation(files("libs/mpv-android-lib-v0.0.1.aar"))
}

That's it! No other configuration is needed.

Usage

Basic implementation example:

// Import the mpv library
import is.xyz.mpv.MPVLib

// Initialize the player
MPVLib.initialize(context)

// Load and play a video file
MPVLib.loadFile("path/to/video.mp4")

// Handle playback controls
MPVLib.play()
MPVLib.pause()

Building

The library can be built using the provided build scripts:

./buildscripts/buildall.sh

Docker build is also supported:

./buildscripts/docker-build.sh

License

This project is licensed under the MIT License - see the LICENSE file for details.

Acknowledgments

  • mpv - The underlying media player
  • Original authors: Ilya Zhuravlev and sfan5