Skip to content

Commit

Permalink
Merge pull request #90 from Tencent/bugfix/android_oncomplete
Browse files Browse the repository at this point in the history
bug: 修复某些错误没有回调onVideoComplete问题
  • Loading branch information
hexleo authored May 20, 2021
2 parents 6e78109 + e4042de commit ae7b0ea
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
2 changes: 2 additions & 0 deletions Android/PlayerProj/animplayer/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,6 @@ dependencies {

// maven central
// 上传指令./gradlew uploadArchives
// https://s01.oss.sonatype.org/
// Staging Repositories -> close -> release
// apply from: "../publish-mavencentral.gradle"
Original file line number Diff line number Diff line change
Expand Up @@ -76,16 +76,18 @@ class AnimPlayer(val animView: IAnimView) {
isStartRunning = true
prepareDecoder()
if (decoder?.prepareThread() == false) {
decoder?.onFailed(Constant.REPORT_ERROR_TYPE_CREATE_THREAD, Constant.ERROR_MSG_CREATE_THREAD)
isStartRunning = false
decoder?.onFailed(Constant.REPORT_ERROR_TYPE_CREATE_THREAD, Constant.ERROR_MSG_CREATE_THREAD)
decoder?.onVideoComplete()
return
}
// 在线程中解析配置
decoder?.renderThread?.handler?.post {
val result = configManager.parseConfig(fileContainer, enableVersion1, videoMode, fps)
if (result != Constant.OK) {
decoder?.onFailed(result, Constant.getErrorMsg(result))
isStartRunning = false
decoder?.onFailed(result, Constant.getErrorMsg(result))
decoder?.onVideoComplete()
return@post
}
ALog.i(TAG, "parse ${configManager.config}")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,7 @@ open class AnimView @JvmOverloads constructor(context: Context, attrs: Attribute
startPlay(fileContainer)
} catch (e: Throwable) {
animProxyListener.onFailed(Constant.REPORT_ERROR_TYPE_FILE_ERROR, Constant.ERROR_MSG_FILE_ERROR)
animProxyListener.onVideoComplete()
}
}

Expand All @@ -241,6 +242,7 @@ open class AnimView @JvmOverloads constructor(context: Context, attrs: Attribute
startPlay(fileContainer)
} catch (e: Throwable) {
animProxyListener.onFailed(Constant.REPORT_ERROR_TYPE_FILE_ERROR, Constant.ERROR_MSG_FILE_ERROR)
animProxyListener.onVideoComplete()
}
}

Expand Down

0 comments on commit ae7b0ea

Please sign in to comment.