diff --git a/.idea/misc.xml b/.idea/misc.xml index 0e6c457a5d..8f8f38573a 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -46,6 +46,11 @@ + + + + + diff --git a/config.gradle b/config.gradle index a4ef87dbfd..5b7c5050cc 100644 --- a/config.gradle +++ b/config.gradle @@ -139,7 +139,7 @@ ext { crashSdk : "com.zhidaoauto.crash.log:library:1.0.5", kotlinstdlibjdk7 : "org.jetbrains.kotlin:kotlin-stdlib-jdk7:${kotlin_version}", - //探路 + //探路使用的直播组件 videoarmv7 : "com.shuyu:gsyVideoPlayer-armv7a:7.1.2", videoarm64 : "com.shuyu:gsyVideoPlayer-arm64:7.1.2", videojava : "com.shuyu:gsyVideoPlayer-java:7.1.2", diff --git a/core/mogo-core-res/build.gradle b/core/mogo-core-res/build.gradle index 058751820b..7f871eaebf 100644 --- a/core/mogo-core-res/build.gradle +++ b/core/mogo-core-res/build.gradle @@ -67,6 +67,11 @@ dependencies { implementation rootProject.ext.dependencies.androidxrecyclerview implementation rootProject.ext.dependencies.androidxconstraintlayout + implementation rootProject.ext.dependencies.videoarmv7 + implementation rootProject.ext.dependencies.videoarm64 + implementation rootProject.ext.dependencies.videojava + implementation rootProject.ext.dependencies.livesdk + if (Boolean.valueOf(RELEASE)) { } else { diff --git a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/view/SimpleLiveVideoPlayer.kt b/core/mogo-core-res/src/main/java/com/mogo/eagle/core/widget/media/video/SimpleVideoPlayer.kt similarity index 90% rename from modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/view/SimpleLiveVideoPlayer.kt rename to core/mogo-core-res/src/main/java/com/mogo/eagle/core/widget/media/video/SimpleVideoPlayer.kt index d1848e219a..52f51d3f69 100644 --- a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/view/SimpleLiveVideoPlayer.kt +++ b/core/mogo-core-res/src/main/java/com/mogo/eagle/core/widget/media/video/SimpleVideoPlayer.kt @@ -1,25 +1,23 @@ -package com.mogo.module.v2x.view - +package com.mogo.eagle.core.widget.media.video import android.content.Context import android.util.AttributeSet import android.view.Surface import android.view.View import android.widget.ImageView -import com.mogo.module.v2x.R +import com.mogo.eagle.core.widget.R import com.shuyu.gsyvideoplayer.GSYVideoManager import com.shuyu.gsyvideoplayer.utils.GSYVideoType import com.shuyu.gsyvideoplayer.video.StandardGSYVideoPlayer -import com.shuyu.gsyvideoplayer.video.base.GSYVideoView import com.shuyu.gsyvideoplayer.video.base.GSYVideoViewBridge /** - * @author congtaowang - * @since 2020/12/8 + * @author donghongyu + * @since 2021/10/25 * - * 描述 + * 视频播放器,直播或者MP4都可支持 */ -class SimpleLiveVideoPlayer : StandardGSYVideoPlayer { +class SimpleVideoPlayer : StandardGSYVideoPlayer { companion object { const val PLAY_EVT_PLAY_LOADING = 1000 @@ -42,7 +40,7 @@ class SimpleLiveVideoPlayer : StandardGSYVideoPlayer { super.init(context) start = findViewById(R.id.start) if (mThumbImageViewLayout != null - && (mCurrentState == -1 || mCurrentState == GSYVideoView.CURRENT_STATE_NORMAL || mCurrentState == GSYVideoView.CURRENT_STATE_ERROR) + && (mCurrentState == -1 || mCurrentState == CURRENT_STATE_NORMAL || mCurrentState == CURRENT_STATE_ERROR) ) { mThumbImageViewLayout.visibility = View.VISIBLE } @@ -58,11 +56,11 @@ class SimpleLiveVideoPlayer : StandardGSYVideoPlayer { } override fun setProgressAndTime( - progress: Int, - secProgress: Int, - currentTime: Int, - totalTime: Int, - forceChange: Boolean + progress: Int, + secProgress: Int, + currentTime: Int, + totalTime: Int, + forceChange: Boolean ) { super.setProgressAndTime(progress, secProgress, currentTime, totalTime, forceChange) if (progress != 0) { diff --git a/modules/mogo-module-v2x/src/main/res/layout/item_v2x_crossroad_live_video.xml b/core/mogo-core-res/src/main/res/layout/item_v2x_crossroad_live_video.xml similarity index 100% rename from modules/mogo-module-v2x/src/main/res/layout/item_v2x_crossroad_live_video.xml rename to core/mogo-core-res/src/main/res/layout/item_v2x_crossroad_live_video.xml diff --git a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/view/V2XCrossRoadVideoView.java b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/view/V2XCrossRoadVideoView.java index 884322b370..acffa65a47 100644 --- a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/view/V2XCrossRoadVideoView.java +++ b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/view/V2XCrossRoadVideoView.java @@ -17,6 +17,7 @@ import com.mogo.cloud.trafficlive.api.MoGoAiCloudTrafficLive; import com.mogo.commons.voice.AIAssist; import com.mogo.eagle.core.utilcode.util.Utils; import com.mogo.eagle.core.widget.RoundLayout; +import com.mogo.eagle.core.widget.media.video.SimpleVideoPlayer; import com.mogo.map.location.MogoLocation; import com.mogo.module.common.entity.MarkerCarInfo; import com.mogo.module.v2x.R; @@ -40,8 +41,8 @@ import java.util.List; import tv.danmaku.ijk.media.player.IjkMediaPlayer; import static com.mogo.module.v2x.V2XConst.MODULE_NAME; -import static com.mogo.module.v2x.view.SimpleLiveVideoPlayer.PLAY_EVT_PLAY_BEGIN; -import static com.mogo.module.v2x.view.SimpleLiveVideoPlayer.PLAY_EVT_PLAY_LOADING; +import static com.mogo.eagle.core.widget.media.video.SimpleVideoPlayer.PLAY_EVT_PLAY_BEGIN; +import static com.mogo.eagle.core.widget.media.video.SimpleVideoPlayer.PLAY_EVT_PLAY_LOADING; /** * author : donghongyu EmArrow @@ -54,7 +55,7 @@ public class V2XCrossRoadVideoView extends RoundLayout { private static final String TAG = "CrossRoadVideo"; - private SimpleLiveVideoPlayer mTxcVideoView; + private SimpleVideoPlayer mTxcVideoView; private final GSYVideoOptionBuilder gsyVideoOptionBuilder = new GSYVideoOptionBuilder(); private ProgressBar mLoading; private ConstraintLayout mClLoadError; diff --git a/modules/mogo-module-v2x/src/main/res/layout/view_video_layout_see_crossroad.xml b/modules/mogo-module-v2x/src/main/res/layout/view_video_layout_see_crossroad.xml index 81d28840f1..ec438d40cf 100644 --- a/modules/mogo-module-v2x/src/main/res/layout/view_video_layout_see_crossroad.xml +++ b/modules/mogo-module-v2x/src/main/res/layout/view_video_layout_see_crossroad.xml @@ -7,7 +7,7 @@ android:background="#3B4577" app:roundLayoutRadius="@dimen/dp_20"> -