Git Product home page Git Product logo

simple-vlc-player's Introduction

Release

[deprecated] simple-vlc-player

I'm not longer maintaining this project due to time constraints.

An Android media player library powered by LibVLC and Open Subtitles.

Notice

I'm currently unable to maintain this project. There are a few open issues that need to be resolved. Pull requests are welcome.

Usage

Options can be provided for the initialization of LibVLC by using the VlcOptionsProvider singleton. This optional configuration should only be provided once during app initialization, or at some point before starting the MediaPlayerActivity. If no options are provided, then a default configuration is provided when initializing LibVLC. To make life easier, the VlcOptionsProvider.Builder class is available to help build a list of common options. If an option is not provided to the builder, then the default value for that option is used. For example, the following enables LibVLC verbose logging, sets the subtitle background opactiy, and sets the subtitle encoding:

VlcOptionsProvider
        .getInstance()
        .setOptions(
                new VlcOptionsProvider.Builder(this)
                        .withSubtitleBackgroundOpacity(255)
                        // See R.array.subtitles_encoding_values
                        .withSubtitleEncoding("KOI8-R")
                        .setVerbose(true)
                        .build()
        );

The MediaPlayerActivity can be started by providing a required media Uri and an optional subtitle Uri. The subtitle Uri must be a local file. Consumers of this library should also supply an opensubtitles.org User-Agent and preferred subtitle language via the intent. As stated in the Open Subtitles documentation, the temporary User-Agent should only be used during development and testing as it periodically changes.

Intent intent = new Intent(this, MediaPlayerActivity.class);

intent.putExtra(MediaPlayerActivity.MediaUri, videoUri);
intent.putExtra(MediaPlayerActivity.SubtitleUri, subtitleUri);
intent.putExtra(MediaPlayerActivity.OpenSubtitlesUserAgent, "TemporaryUserAgent")
// See R.array.language_values
intent.putExtra(MediaPlayerActivity.SubtitleLanguageCode, "rus")

startActivity(intent);

Configuration

Add this in your root build.gradle at the end of repositories:

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

and add the following in the dependent module:

dependencies {
    implementation 'com.github.masterwok:simple-vlc-player:1.1.16'
}

Projects using simple-vlc-player

Licensing

Please refer to the VLC FAQ.

Screenshots

Local Playback Renderer Item Selection Casting Subtitles

simple-vlc-player's People

Contributors

masterwok 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.