Commit 36c0ed2a by 刘鹏

feat: 通话时长问题修复

parent af04c26c
......@@ -5,7 +5,7 @@ ext {
ydlPublishVersion = [
// -------------- 业务模块 --------------
//第三步 若干
"m-confide" : "0.0.49.88",
"m-confide" : "0.0.49.94",
"m-consultant" : "0.0.60.27",
"m-fm" : "0.0.30.09",
"m-user" : "0.0.62.18",
......@@ -41,7 +41,7 @@ ext {
"ydl-webview" : "0.0.38.80",
"ydl-media" : "0.0.21.45",
"ydl-pay" : "0.0.18.19",
"m-audioim" : "0.0.49.29.93",
"m-audioim" : "0.0.49.30.00",
"ydl-flutter-base": "0.0.14.38",
//以下 几乎不会动
......@@ -90,7 +90,7 @@ ext {
// -------------- 业务模块 --------------
//第三步 若干
"m-confide" : "0.0.49.88",
"m-confide" : "0.0.49.94",
"m-consultant" : "0.0.60.27",
"m-fm" : "0.0.30.09",
"m-user" : "0.0.62.18",
......@@ -124,7 +124,7 @@ ext {
"ydl-webview" : "0.0.38.80",
"ydl-media" : "0.0.21.45",
"ydl-pay" : "0.0.18.19",
"m-audioim" : "0.0.49.29.93",
"m-audioim" : "0.0.49.30.00",
"ydl-flutter-base": "0.0.14.38",
//以下 几乎不会动
......
......@@ -75,7 +75,7 @@ dependencies {
kapt "com.alibaba:arouter-compiler:$arouter_compiler"
api "com.alibaba:arouter-api:$arouter_api"
implementation "com.ydl:ydl-av:1.3.9"
implementation "com.ydl:ydl-av:1.4.2"
implementation 'com.volcengine:apm_insight:1.4.6.cn'
if (rootProject.ext.dev_mode){
......
......@@ -524,7 +524,7 @@ class AudioHomeActivity :
writeAgoraLog("主叫方发送的邀请通话消息内容:$content", true)
AliYunRichLogsHelper.getInstance()
.sendRichLog(AliYunLogConfig.AGORA, "主叫方发送的邀请通话消息内容:$content")
localRemainTime = remainTime?.toInt()
localRemainTime = (totalDuration?:1500).minus(remainTime?.toInt()?:1500)
handler = Handler()
vibrator = getSystemService(Service.VIBRATOR_SERVICE) as Vibrator?
}
......@@ -564,8 +564,8 @@ class AudioHomeActivity :
tv_name.text = expertName
tv_tips.text = expertTips
tv_remain_time.text = DateUtils.formatTime(remainTime)
var time = totalDuration?.minus(remainTime!!.toInt())
tv_remain_time.text = DateUtils.formatTime((time).toString())
if (!TextUtils.isEmpty(expertHeadUrl)) {
var option = SimpleImageOpConfiger()
......@@ -740,6 +740,7 @@ class AudioHomeActivity :
YdlCommonRouterManager.getYdlCommonRoute().getUserInfo()!!.headUrl,
YdlCommonRouterManager.getYdlCommonRoute().getUserInfo()!!.userName,
remainTime!!.toInt(),
totalDuration?:1500,
relationId,
callId,
null,
......@@ -901,20 +902,6 @@ class AudioHomeActivity :
if (finishStatus == 0) {
callStartTime = System.currentTimeMillis()
}
// if(finishStatus==1){
// var param = ConnectFinishCommand(listenerUid!!, relationId!!, "0",
// remainTime!!.toInt() - localRemainTime!!, callId!!,
// "0","0","$callStartTime",
// "${System.currentTimeMillis()}",3)
// mPresenter.connectFinish(param)
// }else{
// 接通开始回调
// callStartTime = System.currentTimeMillis()
// var param = ConnectStartCommand(listenerUid!!, relationId!!, callId!!,
// "${System.currentTimeMillis()}","3","0","0","0","0")
// mPresenter.connectStart(param)
// }
}
/**
......@@ -1057,7 +1044,7 @@ class AudioHomeActivity :
mPlayer!!.setCompletionListener(MediaPlayer.OnCompletionListener {
LogUtil.e("播放结束")
//通话剩余时间不足60s时,默认
if (localRemainTime!! < 60 && !TextUtils.isEmpty(commentUrl)) {
if (localRemainTime!! > (totalDuration?:1500).minus(60) && !TextUtils.isEmpty(commentUrl)) {
val h5Params = H5Params(commentUrl!!, "评价")
NewH5Activity.start(this@AudioHomeActivity, h5Params)
}
......@@ -1114,17 +1101,14 @@ class AudioHomeActivity :
//剩余倾诉时长倒计时
totalDisposable =
Observable.interval(0, 1, TimeUnit.SECONDS).subscribeOn(Schedulers.computation())
.take(remainTime!!.toLong() + 1).observeOn(AndroidSchedulers.mainThread())
Observable.interval(0, 1, TimeUnit.SECONDS)
.subscribeOn(Schedulers.computation())
.take(remainTime!!.toLong() + 1)
.observeOn(AndroidSchedulers.mainThread())
.subscribe({
localRemainTime = remainTime!!.toInt() - it.toInt()
if (localRemainTime == 180) {
playNoticeMusic(3)
}
if (localRemainTime == 60) {
playNoticeMusic(1)
}
if (localRemainTime!! <= 60) {
localRemainTime = (totalDuration?:1500).minus(remainTime!!.toInt()).plus(it.toInt())
if (localRemainTime!! >= (totalDuration?:1500).minus(60)) {
if (ll_changeRoute.isEnabled) {
ll_changeRoute.isEnabled = false
}
......@@ -1178,6 +1162,7 @@ class AudioHomeActivity :
YdlCommonRouterManager.getYdlCommonRoute().getUserInfo()!!.headUrl,
YdlCommonRouterManager.getYdlCommonRoute().getUserInfo()!!.userName,
remainTime!!.toInt(),
totalDuration?:1500,
relationId,
callId,
null,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment