This repository has been archived by the owner on Feb 11, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Hawazine H
committed
Oct 25, 2016
1 parent
a174bf7
commit 50fc7a6
Showing
7 changed files
with
133 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
# no-player [![](https://ci.novoda.com/buildStatus/icon?job=no-player)](https://ci.novoda.com/job/no-player/lastBuild/console) [![Download](https://api.bintray.com/packages/novoda/maven/no-player/images/download.svg) ](https://bintray.com/novoda/maven/no-player/_latestVersion) [![](https://raw.githubusercontent.com/novoda/novoda/master/assets/btn_apache_lisence.png)](LICENSE.txt) | ||
|
||
A simplified `Player` wrapper for `MediaPlayer` and `ExoPlayer` | ||
|
||
## Description | ||
|
||
Some of the benefits are - | ||
|
||
- Unified playback interface and event listeners | ||
- `MediaPlayer` buffering | ||
- `ExoPlayer` local, streaming and provisioning widevine modular DRM | ||
- Aspect ratio maintaining | ||
- Player selection based on `ContentType` and DRM | ||
|
||
|
||
## Adding to your project | ||
|
||
To start using this library, add these lines to the `build.gradle` of your project: | ||
|
||
```groovy | ||
repositories { | ||
jcenter() | ||
} | ||
dependencies { | ||
compile 'com.novoda:no-player:<latest-version>' | ||
} | ||
``` | ||
|
||
|
||
## Simple usage | ||
Creating a `Player` | ||
```java | ||
PlayerFactory playerFactory = new PlayerFactory(this, PrioritisedPlayers.prioritiseExoPlayer()); | ||
Player player = new playerFactory.create(DrmHandler.NO_DRM); | ||
``` | ||
Creating the `PlayerView` | ||
```xml | ||
R.layout.player_activity | ||
|
||
<com.novoda.noplayer.NoPlayerView | ||
android:id="@+id/player_view" | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:layout_gravity="center" /> | ||
``` | ||
Attaching to a `PlayerView` | ||
```java | ||
PlayerView playerView = findViewById(R.id.player_view); | ||
player.attach(playerView); | ||
``` | ||
|
||
|
||
Playing Content | ||
|
||
```java | ||
player.addPreparedListener(new Player.PreparedListener() { | ||
@Override | ||
public void onPrepared(PlayerState playerState) { | ||
player.play(); | ||
} | ||
}); | ||
Uri uri = Uri.parse("http://yt-dash-mse-test.commondatastorage.googleapis.com/media/car-20120827-manifest.mpd"); | ||
player.loadVideo(uri, ContentType.DASH); | ||
``` | ||
|
||
|
||
More info on the available properties and other usages in the [Github Wiki](https://github.com/novoda/no-player/wiki). | ||
|
||
|
||
|
||
## Links | ||
|
||
Here are a list of useful links: | ||
|
||
* We always welcome people to contribute new features or bug fixes, [here is how](https://github.com/novoda/novoda/blob/master/CONTRIBUTING.md) | ||
* If you have a problem check the [Issues Page](https://github.com/novoda/no-player/issues) first to see if we are working on it | ||
* For further usage or to delve more deeply checkout the [Project Wiki](https://github.com/novoda/no-player/wiki) | ||
* Looking for community help, browse the already asked [Stack Overflow Questions](http://stackoverflow.com/questions/tagged/support-no-player) or use the tag: `support-landing-strip` when posting a new question | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
#Mon Dec 28 10:00:20 PST 2015 | ||
#Tue Oct 25 13:38:18 BST 2016 | ||
distributionBase=GRADLE_USER_HOME | ||
distributionPath=wrapper/dists | ||
zipStoreBase=GRADLE_USER_HOME | ||
zipStorePath=wrapper/dists | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-all.zip | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-2.2-all.zip |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters