Giter Site home page Giter Site logo

nanyangtaiji / tmediaplayer Goto Github PK

View Code? Open in Web Editor NEW

This project forked from tans5/tmediaplayer

0.0 0.0 0.0 552.47 MB

Android media player library base on FFmpeg 6.0 and support ascii art image filter.

License: Apache License 2.0

C++ 6.36% C 80.57% Kotlin 12.52% CMake 0.28% GLSL 0.27%

tmediaplayer's Introduction

Summary

Android media player library base on FFmpeg 6.0 and support ascii art image filter.

Screenshots

Demo Apk

Usage

Add dependency

dependencies {
	 // ...
    implementation 'io.github.tans5:tmediaplayer:1.0.0-alpha01'
    // ...
}

Play a local media file

val mediaPlayer = tMediaPlayer()

// set media file and use hardware decode.
mediaPlayer.prepare("xxxxx.mp4", true)

// if prepare success, play it.
mediaPlayer.play()

// if you need display images, add a tMediaPlayerView to render it.
mediaPlayer.attachPlayerView(playerView)

When you don't need player, remenber to release it.

mediaPlayer.release()

Basic media player methods.

 mediaPlayer.setListener(object : tMediaPlayerListener {
     /**
      * Player state update
      */
     override fun onPlayerState(state: tMediaPlayerState) {
     }
     /**
      * Play progress update
      */
     override fun onProgressUpdate(progress: Long, duration: Long) {
     }
 })
 mediaPlayer.play()
 
 mediaPlayer.pause()
 
 mediaPlayer.seekTo(0)
 
 mediaPlayer.stop()

Ascii art image filter

Open ascii art image filter

playerView.enableAsciiArtFilter(true)

Ascii art image filter settings

val filter = playerView.getAsciiArtImageFilter()
filter.setCharLineWidth(128)
filter.reverseChar(true)
filter.reverseColor(true)
filter.colorFillRate(1.0f)

tmediaplayer's People

Contributors

tans5 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.