Skip to content

Commit

Permalink
update gradle 3.3.0
Browse files Browse the repository at this point in the history
update build sdk 28
update support sdk 27.1.1
update exoplayer 2.9.3
fix #1762
  • Loading branch information
CarGuoSmall committed Jan 15, 2019
1 parent 7e34da2 commit 2ca8220
Show file tree
Hide file tree
Showing 9 changed files with 34 additions and 55 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,9 @@ public void onBind(final int position, VideoModel videoModel) {
listItemBtn.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
smallVideoHelper.setPlayPositionAndTag(position, TAG);
getRecyclerBaseAdapter().notifyDataSetChanged();
//listVideoUtil.setLoop(true);
smallVideoHelper.setPlayPositionAndTag(position, TAG);
String url;
if (position % 2 == 0) {
url = "https://res.exexm.com/cw_145225549855002";
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ buildscript {
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.1'
classpath 'com.android.tools.build:gradle:3.3.0'

classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5'
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.6'
Expand Down
10 changes: 5 additions & 5 deletions dependencies.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ allprojects {

ext {
//Android
androidBuildToolsVersion = "27.0.2"
androidBuildToolsVersion = "28.0.3"
androidMinSdkVersion = 16
androidTargetSdkVersion = 27
androidCompileSdkVersion = 27
supportLibraryVersion = '27.0.2'
androidTargetSdkVersion = 28
androidCompileSdkVersion = 28
supportLibraryVersion = '27.1.1'

//ViewLibraries
butterKnifeVersion = '8.2.1'
Expand All @@ -31,7 +31,7 @@ ext {

gsyVideoVersion = '6.0.2'

exo_player2 = '2.9.1'
exo_player2 = '2.9.3'

permissionsdispatcher = '3.2.0'

Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.2-all.zip
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@ public class Exo2PlayerManager implements IPlayerManager {

private DummySurface dummySurface;

private Handler handler = new Handler(Looper.getMainLooper());

@Override
public IMediaPlayer getMediaPlayer() {
return mediaPlayer;
Expand Down Expand Up @@ -84,34 +82,24 @@ public void showDisplay(final Message msg) {

@Override
public void setSpeed(final float speed, final boolean soundTouch) {
handler.post(new Runnable() {
@Override
public void run() {
if (mediaPlayer != null) {
try {
mediaPlayer.setSpeed(speed, 1);
} catch (Exception e) {
e.printStackTrace();
}
}
if (mediaPlayer != null) {
try {
mediaPlayer.setSpeed(speed, 1);
} catch (Exception e) {
e.printStackTrace();
}
});
}
}

@Override
public void setNeedMute(final boolean needMute) {
handler.post(new Runnable() {
@Override
public void run() {
if (mediaPlayer != null) {
if (needMute) {
mediaPlayer.setVolume(0, 0);
} else {
mediaPlayer.setVolume(1, 1);
}
}
if (mediaPlayer != null) {
if (needMute) {
mediaPlayer.setVolume(0, 0);
} else {
mediaPlayer.setVolume(1, 1);
}
});
}
}


Expand All @@ -125,19 +113,14 @@ public void releaseSurface() {

@Override
public void release() {
handler.post(new Runnable() {
@Override
public void run() {
if (mediaPlayer != null) {
mediaPlayer.setSurface(null);
mediaPlayer.release();
}
if (dummySurface != null) {
dummySurface.release();
dummySurface = null;
}
}
});
if (mediaPlayer != null) {
mediaPlayer.setSurface(null);
mediaPlayer.release();
}
if (dummySurface != null) {
dummySurface.release();
dummySurface = null;
}
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ public void release() {
try {
mCache.release();
mCache = null;
} catch (Cache.CacheException e) {
} catch (Exception e) {
e.printStackTrace();
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,9 +145,7 @@ public void clearDefaultCache(Context context, @Nullable File cacheDir, @Nullabl
}

protected void init() {
HandlerThread mediaHandlerThread = new HandlerThread(TAG);
mediaHandlerThread.start();
mMediaHandler = new MediaHandler((mediaHandlerThread.getLooper()));
mMediaHandler = new MediaHandler((Looper.getMainLooper()));
mainThreadHandler = new Handler();
}

Expand Down
6 changes: 2 additions & 4 deletions gsyVideoPlayer-proxy_cache/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,8 @@ android {
}

dependencies {
//implementation fileTree(dir: 'libs', include: ['*.jar'])


compile fileTree(dir: 'libs', include: ['*.jar'])
implementation fileTree(dir: 'libs', include: ['*.jar'])
//compile fileTree(dir: 'libs', include: ['*.jar'])
}

apply from: './bintray.gradle'
4 changes: 2 additions & 2 deletions gsyVideoPlayer/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])

api project(':gsyVideoPlayer-java')
//api project(':gsyVideoPlayer-exo_player2')
api project(':gsyVideoPlayer-exo_player2')
//api project(':gsyVideoPlayer-armv5')
//api project(':gsyVideoPlayer-armv7a')
//api project(':gsyVideoPlayer-armv64')
Expand All @@ -49,7 +49,7 @@ dependencies {
//api "com.shuyu:GSYVideoPlayer:$gsyVideoVersion"

//api "com.shuyu:gsyVideoPlayer-java:$gsyVideoVersion"
api "com.shuyu:GSYVideoPlayer-exo2:$gsyVideoVersion"
//api "com.shuyu:GSYVideoPlayer-exo2:$gsyVideoVersion"
api "com.shuyu:gsyVideoPlayer-armv5:$gsyVideoVersion"
api "com.shuyu:gsyVideoPlayer-armv7a:$gsyVideoVersion"
api "com.shuyu:gsyVideoPlayer-arm64:$gsyVideoVersion"
Expand Down

0 comments on commit 2ca8220

Please sign in to comment.