修复策略上报失败问题

This commit is contained in:
tongchenfei
2020-08-31 11:32:32 +08:00
parent 7fdc5e8a2e
commit 6f60672667
4 changed files with 18 additions and 4 deletions

View File

@@ -68,6 +68,11 @@ const val UPLOAD_FROM_STRATEGY_CLOUD_CHECK = "4"
*/
const val UPLOAD_FROM_STRATEGY_ACCIDENT_AUTO = "5"
/**
* 策略上报集合
*/
val STRATEGY_UPLOAD_TYPE_ARRAY = arrayOf(UPLOAD_FROM_STRATEGY_BLOCK_AUTO,
UPLOAD_FROM_STRATEGY_CLOUD_CHECK, UPLOAD_FROM_STRATEGY_ACCIDENT_AUTO)
/**
* 默认视频抓取时长,单位是秒
*/

View File

@@ -9,7 +9,6 @@ import com.mogo.utils.NetworkUtils
import com.zhidao.auto.carcorder.callback.TakePhotoCallback
import com.zhidao.auto.carcorder.callback.TakeVideoCallback
import com.zhidao.auto.carcorder.controller.ZdCarCoderController
import com.zhidao.roadcondition.BuildConfig
import com.zhidao.roadcondition.constant.*
import com.zhidao.roadcondition.event.GetImageSuccessEvent
import com.zhidao.roadcondition.event.LatLngStickyEventBus
@@ -109,7 +108,7 @@ object CarCorderController : TakePhotoCallback, TakeVideoCallback {
this.mLatitude = latitude
if (DebugConfig.getCarMachineType() == 0) { //自研车机
outputVideoPath = getCompressVideoPath()
CustomStatusHandler.offerVideoStatus(TakeEntity(isCustom, id))
CustomStatusHandler.offerVideoStatus(TakeEntity(isCustom, id,fromType))
zdCarCoderController.takeVideo(cameraId, duration)
trackGetVideo(1)
} else { //比亚迪
@@ -118,7 +117,7 @@ object CarCorderController : TakePhotoCallback, TakeVideoCallback {
// TipToast.shortTip("分享失败,请检查网络")
// } else {
//失败了,传空地址,发起请求
val entity = TakeEntity(isCustom, id)
val entity = TakeEntity(isCustom, id,fromType)
videoAndThumbMap["video"] = ""
videoAndThumbMap["thumb"] = ""
@@ -272,6 +271,7 @@ object CarCorderController : TakePhotoCallback, TakeVideoCallback {
}
}
//获取视频成功
override fun onTakeVideoSuccess(camera: Int, videoPath: String?) {
var thumbnailPath =
@@ -304,6 +304,9 @@ object CarCorderController : TakePhotoCallback, TakeVideoCallback {
entity?.let {
if (entity.isCustom) {
compressVideo(videoPath, thumbnailPath, entity)
}else if (entity.fromType in STRATEGY_UPLOAD_TYPE_ARRAY) {
// 属于策略上报
compressVideo(videoPath, thumbnailPath, entity)
} else {
Log.d(
TAG,

View File

@@ -27,5 +27,5 @@ object CustomStatusHandler {
}
class TakeEntity(
var isCustom: Boolean, var id: Long
var isCustom: Boolean, var id: Long, var fromType: String = "0"
)

View File

@@ -66,6 +66,12 @@ public interface IMogoTanluProvider extends IProvider {
*/
String UPLOAD_FROM_STRATEGY_ACCIDENT_AUTO = "5";
/**
* 策略上报集合
*/
String[] STRATEGY_UPLOAD_TYPE_ARRAY = new String[]{UPLOAD_FROM_STRATEGY_BLOCK_AUTO,
UPLOAD_FROM_STRATEGY_CLOUD_CHECK, UPLOAD_FROM_STRATEGY_ACCIDENT_AUTO};
/**
* 默认视频抓取时长
*/