diff --git a/OCH/mogo-och-bus-passenger/src/m2/AndroidManifest.xml b/OCH/mogo-och-bus-passenger/src/m2/AndroidManifest.xml index e0687231c1..c3b74bd86a 100644 --- a/OCH/mogo-och-bus-passenger/src/m2/AndroidManifest.xml +++ b/OCH/mogo-och-bus-passenger/src/m2/AndroidManifest.xml @@ -1,5 +1,7 @@ + + \ No newline at end of file diff --git a/OCH/mogo-och-bus-passenger/src/m2/java/com/mogo/och/bus/passenger/constant/M2Const.kt b/OCH/mogo-och-bus-passenger/src/m2/java/com/mogo/och/bus/passenger/constant/M2Const.kt index 4e7d77c691..65d482b5fd 100644 --- a/OCH/mogo-och-bus-passenger/src/m2/java/com/mogo/och/bus/passenger/constant/M2Const.kt +++ b/OCH/mogo-och-bus-passenger/src/m2/java/com/mogo/och/bus/passenger/constant/M2Const.kt @@ -1,9 +1,5 @@ package com.mogo.och.bus.passenger.constant -import com.mogo.commons.debug.DebugConfig -import com.mogo.eagle.core.data.config.FunctionBuildConfig -import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils - /** * Created on 2021/12/6 */ diff --git a/OCH/mogo-och-bus-passenger/src/m2/java/com/mogo/och/bus/passenger/model/PM2DrivingModel.kt b/OCH/mogo-och-bus-passenger/src/m2/java/com/mogo/och/bus/passenger/model/PM2DrivingModel.kt index 2e692b6b9f..aea76459f3 100644 --- a/OCH/mogo-och-bus-passenger/src/m2/java/com/mogo/och/bus/passenger/model/PM2DrivingModel.kt +++ b/OCH/mogo-och-bus-passenger/src/m2/java/com/mogo/och/bus/passenger/model/PM2DrivingModel.kt @@ -101,7 +101,7 @@ class PM2DrivingModel private constructor() { // 定位监听 CallerChassisLocationGCJ02ListenerManager.addListener(TAG, mMapLocationListener) - CallerChassisLocationGCJ02ListenerManager.setListenerHz(TAG,2)//设置2hz, 1s返回2次 +// CallerChassisLocationGCJ02ListenerManager.setListenerHz(TAG,2)//设置2hz, 1s返回2次 //司乘屏通信监听 CallerTelematicListenerManager.addListener(TAG,mReceivedMsgListener) diff --git a/OCH/mogo-och-bus-passenger/src/m2/java/com/mogo/och/bus/passenger/ui/widget/video/AdvanceGSYVideoPlayer.kt b/OCH/mogo-och-bus-passenger/src/m2/java/com/mogo/och/bus/passenger/ui/widget/video/AdvanceGSYVideoPlayer.kt index fc9654f1e0..f09c063b3e 100644 --- a/OCH/mogo-och-bus-passenger/src/m2/java/com/mogo/och/bus/passenger/ui/widget/video/AdvanceGSYVideoPlayer.kt +++ b/OCH/mogo-och-bus-passenger/src/m2/java/com/mogo/och/bus/passenger/ui/widget/video/AdvanceGSYVideoPlayer.kt @@ -84,11 +84,13 @@ class AdvanceGSYVideoPlayer: StandardGSYVideoPlayer { //失去焦点声音压低 override fun onLossTransientCanDuck() { // setStreamVolume(0.2f) + setNeedMute(true) } //获取焦点声音恢复 override fun onGankAudio() { // setStreamVolume(5.0f) + setNeedMute(false) } private fun setStreamVolume(percent: Float){ @@ -100,4 +102,8 @@ class AdvanceGSYVideoPlayer: StandardGSYVideoPlayer { } mAudioManager.setStreamVolume(AudioManager.STREAM_MUSIC,volume,0) } + + private fun setNeedMute(isMute: Boolean){ + gsyVideoManager?.player?.setNeedMute(isMute) + } } \ No newline at end of file diff --git a/OCH/mogo-och-bus-passenger/src/m2/java/com/mogo/och/bus/passenger/ui/widget/video/AdvanceVideoView.kt b/OCH/mogo-och-bus-passenger/src/m2/java/com/mogo/och/bus/passenger/ui/widget/video/AdvanceVideoView.kt index d69e2df6e0..fe605a8ff0 100644 --- a/OCH/mogo-och-bus-passenger/src/m2/java/com/mogo/och/bus/passenger/ui/widget/video/AdvanceVideoView.kt +++ b/OCH/mogo-och-bus-passenger/src/m2/java/com/mogo/och/bus/passenger/ui/widget/video/AdvanceVideoView.kt @@ -2,24 +2,23 @@ package com.mogo.och.bus.passenger.ui.widget.video import android.annotation.SuppressLint import android.content.Context +import android.os.Environment import android.util.AttributeSet import android.widget.ImageView import android.widget.RelativeLayout +import com.alibaba.idst.nui.FileUtil import com.bumptech.glide.Glide import com.bumptech.glide.request.RequestOptions -import com.mogo.eagle.core.utilcode.breakpoint.Config import com.mogo.eagle.core.utilcode.breakpoint.bean.ThreadBean import com.mogo.eagle.core.utilcode.breakpoint.callback.IDownload import com.mogo.eagle.core.utilcode.breakpoint.utils.DownloadUtils import com.mogo.eagle.core.utilcode.mogo.logger.Logger -import com.mogo.eagle.core.utilcode.util.BitmapHelper -import com.mogo.eagle.core.utilcode.util.FileUtils -import com.mogo.eagle.core.utilcode.util.ThreadPoolService import com.mogo.eagle.core.utilcode.util.ThreadUtils import com.mogo.och.bus.passenger.R -import com.mogo.och.common.module.utils.OCHThreadPoolManager import com.shuyu.gsyvideoplayer.builder.GSYVideoOptionBuilder import com.shuyu.gsyvideoplayer.listener.GSYSampleCallBack +import java.io.File +import java.io.FilenameFilter import java.lang.Exception /** @@ -38,8 +37,10 @@ class AdvanceVideoView @JvmOverloads constructor( private var downloadVideoName = "" private var fileNetPath: String? = "" private var cacheImageUrl: String? = "" + private var mVideoDirPath: String? = "" init { + mVideoDirPath = context.getExternalFilesDir(Environment.DIRECTORY_DOWNLOADS)?.absolutePath + File.separator initView() } @@ -110,8 +111,12 @@ class AdvanceVideoView @JvmOverloads constructor( fun clearLocalErrorVideo(){ if (downloadVideoName.isNotEmpty() - && FileUtils.isFileExists(Config.downLoadPath + downloadVideoName)){ - FileUtils.delete(Config.downLoadPath + downloadVideoName) + && FileUtil.isFileExist(mVideoDirPath + downloadVideoName)){ + FileUtil.delete(mVideoDirPath + downloadVideoName,object: FilenameFilter{ + override fun accept(dir: File?, name: String?): Boolean { + return true + } + }) } } @@ -131,7 +136,11 @@ class AdvanceVideoView @JvmOverloads constructor( mOnCompletionListener = onCompletionListener //判断是否已经下载 if (downloadVideoName.isNotEmpty()){ - if (FileUtils.isFileExists(Config.downLoadPath + downloadVideoName)){ + Logger.d(ImageAndVideoRotation.TAG, + "video local url = $mVideoDirPath$downloadVideoName" + ) + var file = File(mVideoDirPath,downloadVideoName) + if (file.exists()){ Logger.d(ImageAndVideoRotation.TAG, "have cache startPlay") startPlay() return @@ -143,7 +152,7 @@ class AdvanceVideoView @JvmOverloads constructor( private fun startDownLoadVideo(){ //下载视频, 下载成功后再播放 Logger.d(ImageAndVideoRotation.TAG, "startDownLoadVideo") - DownloadUtils.downLoad(context,fileNetPath, Config.downLoadPath + DownloadUtils.downLoad(context,fileNetPath,mVideoDirPath ,downloadVideoName,5,downListener) } @@ -151,7 +160,7 @@ class AdvanceVideoView @JvmOverloads constructor( try { Logger.d(ImageAndVideoRotation.TAG, "startPlay") gsyVideoOptionBuilder = GSYVideoOptionBuilder() - gsyVideoOptionBuilder?.setUrl("file:///mnt/sdcard/downloads/$downloadVideoName") + gsyVideoOptionBuilder?.setUrl("file://$mVideoDirPath$downloadVideoName") // "/data/user/0/com.mogo.launcher.f/files/downloads/" ?.setPlayTag(downloadVideoName) ?.setCacheWithPlay(false) ?.setThumbPlay(false) @@ -192,7 +201,7 @@ class AdvanceVideoView @JvmOverloads constructor( } override fun onProgress(url: String?, length: Int) { -// Logger.d(ImageAndVideoRotation.TAG, "download-onProgress") + Logger.d(ImageAndVideoRotation.TAG, "download-onProgress== $length") } override fun onFinished(url: String?, threadBean: ThreadBean?) { diff --git a/OCH/mogo-och-bus-passenger/src/m2/res/layout/p_m2_driving_info_fragment.xml b/OCH/mogo-och-bus-passenger/src/m2/res/layout/p_m2_driving_info_fragment.xml index 99216870b5..f382d540b3 100644 --- a/OCH/mogo-och-bus-passenger/src/m2/res/layout/p_m2_driving_info_fragment.xml +++ b/OCH/mogo-och-bus-passenger/src/m2/res/layout/p_m2_driving_info_fragment.xml @@ -119,7 +119,7 @@ app:layout_constraintLeft_toLeftOf="@+id/speed_tv" android:textColor="@color/m2_line_during_tv_color"/> - - - = 0){ + startCountDownTimer(minutes + LOOP_PERIOD_60S,LOOP_PERIOD_60S) + }else{ + clearCountDownTimer() + } } override fun onDestroyView() { @@ -165,10 +169,7 @@ class DriverM1Fragment : CharterBaseFragment