Giter Site home page Giter Site logo

libvlc's Introduction

libvlc

vlc for android

The package of libvlc makes it easier to use

Lastest: Build with libvlc:3.2.5

Quick Start

中文介绍

1. Add library to your project:

Add jitpack.io repository to your root build.gradle:

allprojects {
    repositories {
        ...
        maven { url 'https://jitpack.io' }
    }
}

Add library to dependencies

dependencies {
    implementation 'com.github.mafanwei:libvlc:Tag'
}

Usage

Basic usage.

Use VlcVideoLibrary.Builder to build VlcVideoLibrary. And use VlcVideoLibrary to play.

VlcVideoLibrary.Builder builder = new VlcVideoLibrary.Builder(this, true);
//set a render object: Surface/SurfaceView/TextureView/SurfaceTexture
builder.setSurfaceView(surfaceView);
//create VlcVideoLibrary.
VlcVideoLibrary vlcVideoLibrary = builder.create();
//set play url, such as a rtsp.
vlcVideoLibrary.setPlayUrl("rtsp://192.168.31.192:1234");
//set output.
vlcVideoLibrary.setVlcVout();
//now start play:
vlcVideoLibrary.startPlay();

VlcVideoLibrary Builder

VlcVideoLibrary.Builder has some apis to help you.

name description
setWidth set the pixel width of the video
setHeight set the pixel height of the video
setScaleType set the video scale type, by default, scaletype is set to ScaleType.SURFACE_BEST_FIT
setSurface set a render Surface
setSurfaceView set a render SurfaceView
setTextureView set a render TextureView
setSurfaceTexture set a render surfaceTexture
useFullScreen make video full screen
useNoCache make the video not use cache
useRtspTcp it can make rtsp playback more stable, but not all streaming devices support it
addOption if you know the parameters of libvlc, you can use it add some options you want
setOptions set libvlc options
removeOption remove some options you want
clearOptions clear all options
setAutoSize if true make video auto size
setVlcListener set a listener to notice what happened on libvlc

For more apis, please download code.

Donate

Buy a cup of coffee for the author.

alipay

wechat

Other

If you have good ideas, please discuss with me. Pull request is always welcome.

libvlc's People

Contributors

mafanwei avatar

Watchers

 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.