迁移视频播放组件,SimpleVideoPlayer。使用方式参见V2XCrossRoadVideoView,V2XVoiceCallLiveCarWindow

Signed-off-by: 董宏宇 <martindhy@gmail.com>
This commit is contained in:
董宏宇
2021-10-25 16:48:18 +08:00
parent 0626c3d88b
commit 5025bfacc0
7 changed files with 28 additions and 19 deletions

5
.idea/misc.xml generated
View File

@@ -46,6 +46,11 @@
<entry key="modules/mogo-module-service/src/main/res/layout/module_dialog_adas_dispatch_cars.xml" value="0.5546876453218006" />
<entry key="modules/mogo-module-service/src/main/res/layout/module_dialog_adas_dispatch_remind.xml" value="0.35734252929687504" />
<entry key="modules/mogo-module-service/src/main/res/layout/module_services_fragment_online_car_panel.xml" value="0.28919677734374993" />
<entry key="modules/mogo-module-v2x/src/main/res/layout/item_v2x_crossroad_live_video.xml" value="0.12612612612612611" />
<entry key="modules/mogo-module-v2x/src/main/res/layout/item_v2x_see_frontcar_live_video.xml" value="0.23020833333333332" />
<entry key="modules/mogo-module-v2x/src/main/res/layout/view_video_layout_see_crossroad.xml" value="0.23020833333333332" />
<entry key="modules/mogo-module-v2x/src/main/res/layout/view_video_layout_see_live.xml" value="0.23020833333333332" />
<entry key="modules/mogo-module-v2x/src/main/res/layout/window_road_video_layout.xml" value="0.12708333333333333" />
</map>
</option>
</component>

View File

@@ -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",

View File

@@ -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 {

View File

@@ -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) {

View File

@@ -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;

View File

@@ -7,7 +7,7 @@
android:background="#3B4577"
app:roundLayoutRadius="@dimen/dp_20">
<com.mogo.module.v2x.view.SimpleLiveVideoPlayer
<com.mogo.eagle.core.widget.media.video.SimpleVideoPlayer
android:id="@+id/txcVideoView"
android:layout_width="match_parent"
android:layout_height="@dimen/module_v2x_event_see_live_window_height"