Skip to content

Commit

Permalink
Merge pull request #439 from brianwernick/dev_v4
Browse files Browse the repository at this point in the history
Dev v4
  • Loading branch information
brianwernick authored Apr 27, 2017
2 parents f4e45f1 + 997f05e commit f53669e
Show file tree
Hide file tree
Showing 78 changed files with 2,687 additions and 3,349 deletions.
8 changes: 4 additions & 4 deletions .github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
- [ ] I have verified there are no duplicate active or recent bugs, questions, or requests

###### Include the following:
- ExoMedia version: `3.0.0`
- Device OS version: `6.0`
- Devide Manufacturer: `Huawei`
- Device Name: `Nexus 6P`
- ExoMedia version: `4.0.0`
- Device OS version: `7.0`
- Devide Manufacturer: `Google`
- Device Name: `Pixel XL`

###### Reproduction Steps
0.
Expand Down
2 changes: 1 addition & 1 deletion .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
###### Fixes issue #.
###### Addresses issue #.
- [ ] This pull request follows the coding standards

###### This PR changes:
Expand Down
22 changes: 11 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,25 +24,25 @@ repositories {
}
dependencies {
compile 'com.devbrackets.android:exomedia:3.1.1'
compile 'com.devbrackets.android:exomedia:4.0.0'
}
```

Example
-------
The EMVideoView (EM for ExoMedia) can be added in your layout files like any other Android view.
The ExoMedia VideoView can be added in your layout files like any other Android view.

```xml
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:EMVideoView="http://schemas.android.com/apk/res-auto"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent">

<com.devbrackets.android.exomedia.ui.widget.EMVideoView
<com.devbrackets.android.exomedia.ui.widget.VideoView
android:id="@+id/video_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
EMVideoView:useDefaultControls="true"/>
app:useDefaultControls="true"/>

</RelativeLayout>
```
Expand All @@ -51,26 +51,26 @@ While in your Activity or Fragment you treat it like a standard Android VideoVie

```java
private void setupVideoView() {
EMVideoView emVideoView = (EMVideoView)findViewById(R.id.video_view);
emVideoView.setOnPreparedListener(this);
VideoView videoView = (VideoView)findViewById(R.id.video_view);
videoView.setOnPreparedListener(this);

//For now we just picked an arbitrary item to play. More can be found at
//https://archive.org/details/more_animation
emVideoView.setVideoURI(Uri.parse("https://archive.org/download/Popeye_forPresident/Popeye_forPresident_512kb.mp4"));
videoView.setVideoURI(Uri.parse("https://archive.org/download/Popeye_forPresident/Popeye_forPresident_512kb.mp4"));
}

@Override
public void onPrepared() {
//Starts the video playback as soon as it is ready
emVideoView.start();
videoView.start();
}
```


License
-------

Copyright 2017 Brian Wernick
Copyright 2015-2017 Brian Wernick

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand All @@ -95,6 +95,6 @@ Attribution
[CTS]: https://source.android.com/compatibility/cts/index.html
[Design Icons]: https://github.com/google/material-design-icons
[ExoPlayer]: https://github.com/google/ExoPlayer
[Java Docs]: https://devbrackets.com/dev/libs/docs/exomedia/3.1.0/index.html
[Java Docs]: https://devbrackets.com/dev/libs/docs/exomedia/4.0.0/index.html
[JCenter]: https://bintray.com/brianwernick/maven/ExoMedia/view#files
[Website]: https://devbrackets.com/dev/libs/exomedia.html
10 changes: 4 additions & 6 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,17 +1,15 @@
buildscript {
repositories {
mavenLocal()
jcenter();
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2.3'
classpath 'com.novoda:bintray-release:0.3.4'
classpath 'com.android.tools.build:gradle:2.3.1'
classpath 'com.novoda:bintray-release:0.4.0'
}
}

allprojects {
repositories {
mavenLocal()
jcenter();
jcenter()
}
}
13 changes: 10 additions & 3 deletions demo/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,11 @@ apply plugin: 'com.android.application'

dependencies {
compile project(':library')
compile 'com.android.support:appcompat-v7:25.1.0'
compile 'com.squareup.picasso:picasso:2.5.2'
compile 'com.android.support:appcompat-v7:25.3.1'
compile 'com.google.android.exoplayer:extension-okhttp:r2.4.0'

// Image Loading
compile 'com.github.bumptech.glide:glide:3.7.0'

// Playlist support
compile 'com.devbrackets.android:playlistcore:1.1.1'
Expand All @@ -21,6 +24,10 @@ android {
minSdkVersion 14
targetSdkVersion 25
versionCode 1
versionName "1.0"
versionName "1.0.0"
}

lintOptions {
abortOnError false
}
}
23 changes: 23 additions & 0 deletions demo/src/main/java/com/devbrackets/android/exomediademo/App.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,19 @@

import android.app.Application;
import android.os.StrictMode;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;

import com.devbrackets.android.exomedia.ExoMedia;
import com.devbrackets.android.exomediademo.manager.PlaylistManager;
import com.google.android.exoplayer2.ext.okhttp.OkHttpDataSourceFactory;
import com.google.android.exoplayer2.upstream.DataSource;
import com.google.android.exoplayer2.upstream.HttpDataSource;
import com.google.android.exoplayer2.upstream.TransferListener;
import com.squareup.leakcanary.LeakCanary;

import okhttp3.OkHttpClient;

public class App extends Application {

private static App application;
Expand All @@ -19,6 +28,8 @@ public void onCreate() {
application = this;
playlistManager = new PlaylistManager();
LeakCanary.install(this);

configureExoMedia();
}

@Override
Expand Down Expand Up @@ -51,4 +62,16 @@ private void enableStrictMode() {
.penaltyLog()
.build());
}

private void configureExoMedia() {
// Registers the media sources to use the OkHttp client instead of the standard Apache one
// Note: the OkHttpDataSourceFactory can be found in the ExoPlayer extension library `extension-okhttp`
ExoMedia.setHttpDataSourceFactoryProvider(new ExoMedia.HttpDataSourceFactoryProvider() {
@NonNull
@Override
public HttpDataSource.BaseFactory provide(@NonNull String userAgent, @Nullable TransferListener<? super DataSource> listener) {
return new OkHttpDataSourceFactory(new OkHttpClient(), userAgent, listener);
}
});
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,10 @@ public class Samples {

//Video items
videoSamples = new ArrayList<>();
videoSamples.add(new Sample("3GP - Big Buck Bunny by Blender", "http://www.sample-videos.com/video/3gp/240/big_buck_bunny_240p_10mb.3gp"));
// videoSamples.add(new Sample("FLV - Big Buck Bunny by Blender", "http://www.sample-videos.com/video/flv/720/big_buck_bunny_720p_5mb.flv"));
videoSamples.add(new Sample("FLV - Big Buck Bunny by Blender", "http://vod.leasewebcdn.com/bbb.flv?ri=1024&rs=150&start=0"));
videoSamples.add(new Sample("HLS - Wildlife", "http://playertest.longtailvideo.com/adaptive/wowzaid3/playlist.m3u8"));
videoSamples.add(new Sample("MKV - Big Buck Bunny by Blender", "http://www.sample-videos.com/video/mkv/480/big_buck_bunny_480p_10mb.mkv"));
videoSamples.add(new Sample("MP4 - Big Buck Bunny by Blender", "http://www.sample-videos.com/video/mp4/480/big_buck_bunny_480p_10mb.mp4"));
videoSamples.add(new Sample("MKV - Android Screens", "http://storage.googleapis.com/exoplayer-test-media-1/mkv/android-screens-lavf-56.36.100-aac-avc-main-1280x720.mkv"));
videoSamples.add(new Sample("MP4 (VP9) - Google Glass", "http://demos.webmproject.org/exoplayer/glass.mp4"));
videoSamples.add(new Sample("MPEG DASH - Sintel by Blender", "https://bitdash-a.akamaihd.net/content/sintel/sintel.mpd"));
videoSamples.add(new Sample("MPEG DASH - Big Buck Bunny by Blender, Live", "https://wowzaec2demo.streamlock.net/live/bigbuckbunny/manifest_mpm4sav_mvtime.mpd"));
videoSamples.add(new Sample("Smooth Stream - Caminandes: Llama Drama by Blender", "http://amssamples.streaming.mediaservices.windows.net/634cd01c-6822-4630-8444-8dd6279f94c6/CaminandesLlamaDrama4K.ism/manifest"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import android.support.annotation.Nullable;

import com.devbrackets.android.exomedia.listener.VideoControlsButtonListener;
import com.devbrackets.android.exomedia.ui.widget.EMVideoView;
import com.devbrackets.android.exomedia.ui.widget.VideoView;
import com.devbrackets.android.exomedia.ui.widget.VideoControls;
import com.devbrackets.android.exomediademo.App;
import com.devbrackets.android.exomediademo.data.MediaItem;
Expand Down Expand Up @@ -50,7 +50,7 @@ public void setVideoPlayer(@Nullable VideoPlayerApi videoPlayer) {
*/
private void updateVideoControls(@NonNull VideoPlayerApi videoPlayer) {
VideoApi api = (VideoApi)videoPlayer;
EMVideoView videoView = api.getVideoView();
VideoView videoView = api.getVideoView();
if (videoView == null) {
return;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@
import android.support.annotation.IntRange;
import android.support.annotation.NonNull;

import com.devbrackets.android.exomedia.EMAudioPlayer;
import com.devbrackets.android.exomedia.AudioPlayer;
import com.devbrackets.android.playlistcore.api.AudioPlayerApi;

public class AudioApi extends BaseMediaApi implements AudioPlayerApi {
private EMAudioPlayer audioPlayer;
private AudioPlayer audioPlayer;

public AudioApi(EMAudioPlayer audioPlayer) {
public AudioApi(AudioPlayer audioPlayer) {
this.audioPlayer = audioPlayer;

audioPlayer.setOnErrorListener(this);
Expand Down Expand Up @@ -68,13 +68,13 @@ public void setStreamType(int streamType) {
}

@Override
public void setWakeMode(Context context, int mode) {
public void setWakeMode(@NonNull Context context, int mode) {
audioPlayer.setWakeMode(context, mode);
}

@Override
public void setDataSource(@NonNull Context context, @NonNull Uri uri) {
audioPlayer.setDataSource(context, uri);
audioPlayer.setDataSource(uri);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public void onPrepared() {
}

@Override
public boolean onError() {
public boolean onError(Exception e) {
return errorListener != null && errorListener.onError(this);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
import android.support.annotation.IntRange;
import android.support.annotation.NonNull;

import com.devbrackets.android.exomedia.ui.widget.EMVideoView;
import com.devbrackets.android.exomedia.ui.widget.VideoView;
import com.devbrackets.android.playlistcore.api.VideoPlayerApi;

public class VideoApi extends BaseMediaApi implements VideoPlayerApi {
private EMVideoView videoView;
private VideoView videoView;

public VideoApi(EMVideoView videoView) {
public VideoApi(VideoView videoView) {
this.videoView = videoView;

videoView.setOnErrorListener(this);
Expand Down Expand Up @@ -81,7 +81,7 @@ public int getBufferedPercent() {
return videoView.getBufferPercentage();
}

public EMVideoView getVideoView() {
public VideoView getVideoView() {
return videoView;
}
}
Loading

0 comments on commit f53669e

Please sign in to comment.