Giter Club home page Giter Club logo

no-player's Introduction

This project is no longer under maintenance - 13/7/2020

Upgrades to latests version of ExoPlayer requires a significative amount of changes. The project is no longer maintained from our end.


noplayer

CI status Download from Bintray Tests Coverage Apache 2.0 Licence

A simplified Android Player wrapper for MediaPlayer and ExoPlayer.

Description

Some of the benefits are:

  • Unified playback interface and event listeners for ExoPlayer and MediaPlayer
  • MediaPlayer buffering
  • ExoPlayer local, streaming and provisioning WideVine Modular DRM
  • Maintains video Aspect Ratio by default
  • Player selection based on ContentType and DRM

Experimental Features, use with caution:

  • Support for TextureView

Adding to your project

To start using this library, add these lines to the build.gradle of your project:

repositories {
    jcenter()
}

dependencies {
    implementation 'com.novoda:no-player:<latest-version>'
}

From no-player 4.5.0 this is also needed in the android section of your build.gradle

compileOptions {
        targetCompatibility JavaVersion.VERSION_1_8
}

Simple usage

  1. Create a Player:

    Player player = new PlayerBuilder()
      .withPriority(PlayerType.EXO_PLAYER)
      .withWidevineModularStreamingDrm(drmHandler)
      .build(this);
  2. Create the PlayerView:

    <com.novoda.noplayer.NoPlayerView
      android:id="@+id/player_view"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:layout_gravity="center" />
  3. Attach to a PlayerView:

    PlayerView playerView = findViewById(R.id.player_view);
    player.attach(playerView);
  4. Play some content:

    player.getListeners().addPreparedListener(playerState -> player.play());
    
    Uri uri = Uri.parse(mpdUrl);
    player.loadVideo(uri, ContentType.DASH);

Snapshots

CI status Download from Bintray

Snapshot builds from develop are automatically deployed to a repository that is not synced with JCenter. To consume a snapshot build add an additional maven repo as follows:

repositories {
    maven {
        url 'https://dl.bintray.com/novoda-oss/snapshots/'
    }
}

You can find the latest snapshot version following this link.

Contributing

We always welcome people to contribute new features or bug fixes, here is how.

If you have a problem, check the Issues Page first to see if we are already working on it.

Looking for community help? Browse the already asked Stack Overflow Questions or use the tag support-no-player when posting a new question.

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.