Skip to content

Commit

Permalink
Update ExoPlayer dependency to 2.18
Browse files Browse the repository at this point in the history
  • Loading branch information
Ben Staveley-Taylor committed Apr 5, 2023
1 parent 062eeaf commit d2bb0c8
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 10 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<img src="https://img.shields.io/badge/license-MIT-green.svg?style=flat">
[![API](https://img.shields.io/badge/API-16%2B-blue.svg?style=flat)](https://android-arsenal.com/api?level=16)

This library uses OpenGL Shaders to apply effects on [ExoPlayer](https://github.com/google/ExoPlayer) video at Runtime and <br> depends EXOPlayer core 2.14.0.<br>
This library uses OpenGL Shaders to apply effects on [ExoPlayer](https://github.com/google/ExoPlayer) video at Runtime and <br> depends EXOPlayer core 2.18.0.<br>
<img src="art/art.gif" width="33.33%">

## Gradle
Expand All @@ -20,10 +20,10 @@ Step 2. Add the dependency
```groovy
dependencies {
implementation 'com.github.MasayukiSuda:ExoPlayerFilter:v0.2.6'
implementation 'com.google.android.exoplayer:exoplayer-core:2.14.0'
implementation 'com.google.android.exoplayer:exoplayer-core:2.18.0'
}
```
This library depends ExoPlayer core 2.14.0
This library depends ExoPlayer core 2.18.0

## Sample Usage

Expand Down
2 changes: 1 addition & 1 deletion epf/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,5 @@ android {
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'androidx.appcompat:appcompat:1.6.1'
compileOnly 'com.google.android.exoplayer:exoplayer-core:2.14.0'
compileOnly 'com.google.android.exoplayer:exoplayer-core:2.18.0'
}
16 changes: 11 additions & 5 deletions epf/src/main/java/com/daasuu/epf/EPlayerView.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,14 @@
import com.daasuu.epf.chooser.EConfigChooser;
import com.daasuu.epf.contextfactory.EContextFactory;
import com.daasuu.epf.filter.GlFilter;
import com.google.android.exoplayer2.Player;
import com.google.android.exoplayer2.SimpleExoPlayer;
import com.google.android.exoplayer2.video.VideoListener;
import com.google.android.exoplayer2.video.VideoSize;

/**
* Created by sudamasayuki on 2017/05/16.
*/
public class EPlayerView extends GLSurfaceView implements VideoListener {
public class EPlayerView extends GLSurfaceView implements Player.Listener {

private final static String TAG = EPlayerView.class.getSimpleName();

Expand Down Expand Up @@ -44,7 +45,7 @@ public EPlayerView setSimpleExoPlayer(SimpleExoPlayer player) {
this.player = null;
}
this.player = player;
this.player.addVideoListener(this);
this.player.addListener(this);
this.renderer.setSimpleExoPlayer(player);
return this;
}
Expand Down Expand Up @@ -90,10 +91,15 @@ public void onPause() {
}

//////////////////////////////////////////////////////////////////////////
// SimpleExoPlayer.VideoListener
// Player.Listener

@Override
public void onVideoSizeChanged(int width, int height, int unappliedRotationDegrees, float pixelWidthHeightRatio) {
public void onVideoSizeChanged(VideoSize videoSize) {
int width = videoSize.width;
int height = videoSize.height;
float pixelWidthHeightRatio = videoSize.pixelWidthHeightRatio;
int unappliedRotationDegrees = videoSize.unappliedRotationDegrees;

// Log.d(TAG, "width = " + width + " height = " + height + " unappliedRotationDegrees = " + unappliedRotationDegrees + " pixelWidthHeightRatio = " + pixelWidthHeightRatio);
videoAspect = ((float) width / height) * pixelWidthHeightRatio;
// Log.d(TAG, "videoAspect = " + videoAspect);
Expand Down
2 changes: 1 addition & 1 deletion sample/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,5 @@ dependencies {

implementation project(':epf')

implementation 'com.google.android.exoplayer:exoplayer-core:2.14.0'
implementation 'com.google.android.exoplayer:exoplayer-core:2.18.0'
}

0 comments on commit d2bb0c8

Please sign in to comment.