diff --git a/gsyVideoPlayer-exo_player2/src/main/java/tv/danmaku/ijk/media/exo2/Exo2PlayerManager.java b/gsyVideoPlayer-exo_player2/src/main/java/tv/danmaku/ijk/media/exo2/Exo2PlayerManager.java index f0dfee941..b4ac0db92 100644 --- a/gsyVideoPlayer-exo_player2/src/main/java/tv/danmaku/ijk/media/exo2/Exo2PlayerManager.java +++ b/gsyVideoPlayer-exo_player2/src/main/java/tv/danmaku/ijk/media/exo2/Exo2PlayerManager.java @@ -131,6 +131,7 @@ public void release() { if (mediaPlayer != null) { mediaPlayer.setSurface(null); mediaPlayer.release(); + mediaPlayer = null; } if (dummySurface != null) { dummySurface.release(); diff --git a/gsyVideoPlayer-java/src/main/java/com/shuyu/gsyvideoplayer/player/IjkPlayerManager.java b/gsyVideoPlayer-java/src/main/java/com/shuyu/gsyvideoplayer/player/IjkPlayerManager.java index 5a8f25643..7544ad1a4 100644 --- a/gsyVideoPlayer-java/src/main/java/com/shuyu/gsyvideoplayer/player/IjkPlayerManager.java +++ b/gsyVideoPlayer-java/src/main/java/com/shuyu/gsyvideoplayer/player/IjkPlayerManager.java @@ -183,6 +183,7 @@ public void releaseSurface() { public void release() { if (mediaPlayer != null) { mediaPlayer.release(); + mediaPlayer = null; } } diff --git a/gsyVideoPlayer-java/src/main/java/com/shuyu/gsyvideoplayer/player/SystemPlayerManager.java b/gsyVideoPlayer-java/src/main/java/com/shuyu/gsyvideoplayer/player/SystemPlayerManager.java index 7dd093aa6..a648f4d1a 100644 --- a/gsyVideoPlayer-java/src/main/java/com/shuyu/gsyvideoplayer/player/SystemPlayerManager.java +++ b/gsyVideoPlayer-java/src/main/java/com/shuyu/gsyvideoplayer/player/SystemPlayerManager.java @@ -124,6 +124,7 @@ public void release() { if (mediaPlayer != null) { release = true; mediaPlayer.release(); + mediaPlayer = null; } lastTotalRxBytes = 0; lastTimeStamp = 0; diff --git a/gsyVideoPlayer/build.gradle b/gsyVideoPlayer/build.gradle index 9da0cab07..01afbc483 100644 --- a/gsyVideoPlayer/build.gradle +++ b/gsyVideoPlayer/build.gradle @@ -35,8 +35,8 @@ android { dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) - //api project(':gsyVideoPlayer-java') - //api project(':gsyVideoPlayer-exo_player2') + api project(':gsyVideoPlayer-java') + api project(':gsyVideoPlayer-exo_player2') //api project(':gsyVideoPlayer-armv5') //api project(':gsyVideoPlayer-armv7a') //api project(':gsyVideoPlayer-armv64') @@ -48,8 +48,8 @@ dependencies { //api "com.shuyu:GSYVideoPlayer:$gsyVideoVersion" - api "com.shuyu:gsyVideoPlayer-java:$gsyVideoVersion" - api "com.shuyu:GSYVideoPlayer-exo2:$gsyVideoVersion" + //api "com.shuyu:gsyVideoPlayer-java:$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"