[Add]升级ZeGo-SDK版本2.14.0.5551_stable_video
增加了多路直播同时观看功能
This commit is contained in:
@@ -10,6 +10,7 @@ import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
import android.widget.ToggleButton;
|
||||
|
||||
|
||||
import com.mogo.cloud.live.manager.LiveStreamManagerImpl;
|
||||
import com.mogo.cloud.passport.MoGoAiCloudClientConfig;
|
||||
import com.mogo.cloud.trafficlive.api.ITrafficCarLiveCallBack;
|
||||
@@ -20,42 +21,107 @@ import com.mogo.cloud.wifi.WifiStateManager;
|
||||
|
||||
public class LivePlayActivity extends AppCompatActivity implements ITrafficCarLiveCallBack, IWifiStateListener {
|
||||
private String TAG = "LiveActivity";
|
||||
|
||||
private SurfaceView surfaceView;
|
||||
private ToggleButton liveToggleBtn;
|
||||
private EditText etLookRoomId;
|
||||
private TextView tvWifiState;
|
||||
private String liveSn;
|
||||
|
||||
private SurfaceView surfaceView0;
|
||||
private ToggleButton liveToggleBtn0;
|
||||
private EditText etLookRoomId0;
|
||||
private String liveSn0;
|
||||
|
||||
private SurfaceView surfaceView1;
|
||||
private ToggleButton liveToggleBtn1;
|
||||
private EditText etLookRoomId1;
|
||||
private String liveSn1;
|
||||
|
||||
private SurfaceView surfaceView2;
|
||||
private ToggleButton liveToggleBtn2;
|
||||
private EditText etLookRoomId2;
|
||||
private String liveSn2;
|
||||
|
||||
private SurfaceView surfaceView3;
|
||||
private ToggleButton liveToggleBtn3;
|
||||
private EditText etLookRoomId3;
|
||||
private String liveSn3;
|
||||
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_live_play);
|
||||
surfaceView = findViewById(R.id.surfaceView);
|
||||
etLookRoomId = findViewById(R.id.etLookRoomId);
|
||||
liveToggleBtn = findViewById(R.id.liveToggleBtn);
|
||||
tvWifiState = findViewById(R.id.tvWifiState);
|
||||
|
||||
LiveStreamManagerImpl.getInstance(this.getApplication(),
|
||||
MoGoAiCloudClientConfig.getInstance().getSn(),false);
|
||||
liveToggleBtn.setOnCheckedChangeListener((buttonView, isChecked) -> {
|
||||
MoGoAiCloudClientConfig.getInstance().getSn(), false);
|
||||
tvWifiState = findViewById(R.id.tvWifiState);
|
||||
|
||||
surfaceView0 = findViewById(R.id.surfaceView0);
|
||||
etLookRoomId0 = findViewById(R.id.etLookRoomId0);
|
||||
liveToggleBtn0 = findViewById(R.id.liveToggleBtn0);
|
||||
|
||||
liveToggleBtn0.setOnCheckedChangeListener((buttonView, isChecked) -> {
|
||||
Toast.makeText(getApplicationContext(), buttonView.getText(), Toast.LENGTH_SHORT).show();
|
||||
if (isChecked) {
|
||||
liveSn = etLookRoomId.getText().toString().trim();
|
||||
MoGoAiCloudTrafficLive.viewDesignativeVehicleLive(liveSn, surfaceView, this);
|
||||
//just for test
|
||||
liveSn0 = etLookRoomId0.getText().toString().trim();
|
||||
MoGoAiCloudTrafficLive.viewDesignativeVehicleLive(liveSn0, surfaceView0, this);
|
||||
// MoGoAiCloudTrafficLive.viewFrontVehicleLive(39.968253, 116.410829, 0, surfaceView, this);
|
||||
} else {
|
||||
MoGoAiCloudTrafficLive.stopCarLive(liveSn);
|
||||
MoGoAiCloudTrafficLive.stopCarLive(liveSn0);
|
||||
}
|
||||
});
|
||||
|
||||
surfaceView1 = findViewById(R.id.surfaceView1);
|
||||
etLookRoomId1 = findViewById(R.id.etLookRoomId1);
|
||||
liveToggleBtn1 = findViewById(R.id.liveToggleBtn1);
|
||||
|
||||
liveToggleBtn1.setOnCheckedChangeListener((buttonView, isChecked) -> {
|
||||
Toast.makeText(getApplicationContext(), buttonView.getText(), Toast.LENGTH_SHORT).show();
|
||||
if (isChecked) {
|
||||
liveSn1 = etLookRoomId1.getText().toString().trim();
|
||||
MoGoAiCloudTrafficLive.viewDesignativeVehicleLive(liveSn1, surfaceView1, this);
|
||||
// MoGoAiCloudTrafficLive.viewFrontVehicleLive(39.968253, 116.410829, 0, surfaceView, this);
|
||||
} else {
|
||||
MoGoAiCloudTrafficLive.stopCarLive(liveSn1);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
surfaceView2 = findViewById(R.id.surfaceView2);
|
||||
etLookRoomId2 = findViewById(R.id.etLookRoomId2);
|
||||
liveToggleBtn2 = findViewById(R.id.liveToggleBtn2);
|
||||
|
||||
liveToggleBtn2.setOnCheckedChangeListener((buttonView, isChecked) -> {
|
||||
Toast.makeText(getApplicationContext(), buttonView.getText(), Toast.LENGTH_SHORT).show();
|
||||
if (isChecked) {
|
||||
liveSn2 = etLookRoomId2.getText().toString().trim();
|
||||
MoGoAiCloudTrafficLive.viewDesignativeVehicleLive(liveSn2, surfaceView2, this);
|
||||
// MoGoAiCloudTrafficLive.viewFrontVehicleLive(39.968253, 116.410829, 0, surfaceView, this);
|
||||
} else {
|
||||
MoGoAiCloudTrafficLive.stopCarLive(liveSn2);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
surfaceView3 = findViewById(R.id.surfaceView3);
|
||||
etLookRoomId3 = findViewById(R.id.etLookRoomId3);
|
||||
liveToggleBtn3 = findViewById(R.id.liveToggleBtn3);
|
||||
|
||||
liveToggleBtn3.setOnCheckedChangeListener((buttonView, isChecked) -> {
|
||||
Toast.makeText(getApplicationContext(), buttonView.getText(), Toast.LENGTH_SHORT).show();
|
||||
if (isChecked) {
|
||||
liveSn3 = etLookRoomId3.getText().toString().trim();
|
||||
MoGoAiCloudTrafficLive.viewDesignativeVehicleLive(liveSn3, surfaceView3, this);
|
||||
// MoGoAiCloudTrafficLive.viewFrontVehicleLive(39.968253, 116.410829, 0, surfaceView, this);
|
||||
} else {
|
||||
MoGoAiCloudTrafficLive.stopCarLive(liveSn3);
|
||||
}
|
||||
});
|
||||
|
||||
WifiStateManager.getInstance().registerWifiStateListener(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onDestroy() {
|
||||
super.onDestroy();
|
||||
MoGoAiCloudTrafficLive.stopCarLive(liveSn);
|
||||
MoGoAiCloudTrafficLive.stopCarLive(liveSn0);
|
||||
WifiStateManager.getInstance().unRegisterWifiStateListener(this);
|
||||
}
|
||||
|
||||
|
||||
@@ -102,7 +102,7 @@ public class LivePlayAndPushActivity extends BaseLiveActivity
|
||||
liveSn = etLookRoomId.getText().toString().trim();
|
||||
liveStreamManager.getMoGoLiveManager().loginMultiRoom(liveSn);
|
||||
} else {
|
||||
liveStreamManager.getMoGoLiveManager().logoutMultiRoom();
|
||||
liveStreamManager.getMoGoLiveManager().logoutMultiRoom(liveSn);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -58,7 +58,7 @@ public class MoGoApplication extends MultiDexApplication {
|
||||
// 设置AI云平台分配给三方应用的签名密钥,需要从AI云平台申请
|
||||
// 设置车机设备的唯一标识(这些表识必须是通过后台录入的设备)
|
||||
// TODO 这里使用的是测试的sn
|
||||
clientConfig.setThirdPartyDeviceId("C95ACB94DF240C89");
|
||||
clientConfig.setThirdPartyDeviceId("1234567899876543214");
|
||||
// 设置应用服务AppId 长链、鉴权 //todo 需要卸载智慧驾驶、行车记录仪
|
||||
clientConfig.setServiceAppId("com.mogo.launcher");
|
||||
// 设置循环检测间隔时间
|
||||
@@ -71,7 +71,7 @@ public class MoGoApplication extends MultiDexApplication {
|
||||
@Nullable
|
||||
@Override
|
||||
public HttpDnsSimpleLocation getCurrentLocation() {
|
||||
return new HttpDnsSimpleLocation("010", randomLat, randomLon);
|
||||
return new HttpDnsSimpleLocation("0734", randomLat, randomLon);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@@ -1,41 +1,178 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
android:layout_height="match_parent"
|
||||
android:background="#FFF"
|
||||
android:orientation="vertical">
|
||||
|
||||
<SurfaceView
|
||||
android:id="@+id/surfaceView"
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/etLookRoomId"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:hint="请输入要查看的车机SN"
|
||||
android:text="X2020210706B95ACB94DF240C88"
|
||||
android:textColor="#FFFF"
|
||||
app:layout_constraintBottom_toTopOf="@+id/liveToggleBtn"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1"
|
||||
android:orientation="horizontal"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent" />
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<android.support.constraint.ConstraintLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1">
|
||||
|
||||
<SurfaceView
|
||||
android:id="@+id/surfaceView0"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
tools:layout_editor_absoluteX="0dp"
|
||||
tools:layout_editor_absoluteY="0dp" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/etLookRoomId0"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:hint="请输入要查看的车机SN"
|
||||
android:text="F803EB2046PZD00274"
|
||||
android:textColor="#000"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent" />
|
||||
|
||||
<ToggleButton
|
||||
android:id="@+id/liveToggleBtn0"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textOff="开始拉流"
|
||||
android:textOn="停止拉流"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent" />
|
||||
</android.support.constraint.ConstraintLayout>
|
||||
|
||||
|
||||
<android.support.constraint.ConstraintLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1">
|
||||
|
||||
<SurfaceView
|
||||
android:id="@+id/surfaceView1"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/etLookRoomId1"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:hint="请输入要查看的车机SN"
|
||||
android:text="F803EB2046PZD00188"
|
||||
android:textColor="#000"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent" />
|
||||
|
||||
<ToggleButton
|
||||
android:id="@+id/liveToggleBtn1"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textOff="开始拉流"
|
||||
android:textOn="停止拉流"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent" />
|
||||
</android.support.constraint.ConstraintLayout>
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1"
|
||||
android:orientation="horizontal"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<android.support.constraint.ConstraintLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1">
|
||||
|
||||
<SurfaceView
|
||||
android:id="@+id/surfaceView2"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
tools:layout_editor_absoluteX="0dp"
|
||||
tools:layout_editor_absoluteY="0dp" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/etLookRoomId2"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:hint="请输入要查看的车机SN"
|
||||
android:text="F803EB2046PZD00149"
|
||||
android:textColor="#000"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent" />
|
||||
|
||||
<ToggleButton
|
||||
android:id="@+id/liveToggleBtn2"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textOff="开始拉流"
|
||||
android:textOn="停止拉流"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent" />
|
||||
</android.support.constraint.ConstraintLayout>
|
||||
|
||||
|
||||
<android.support.constraint.ConstraintLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1">
|
||||
|
||||
<SurfaceView
|
||||
android:id="@+id/surfaceView3"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/etLookRoomId3"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:hint="请输入要查看的车机SN"
|
||||
android:text="F803EB2046PZD00167"
|
||||
android:textColor="#000"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent" />
|
||||
|
||||
<ToggleButton
|
||||
android:id="@+id/liveToggleBtn3"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textOff="开始拉流"
|
||||
android:textOn="停止拉流"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent" />
|
||||
</android.support.constraint.ConstraintLayout>
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<ToggleButton
|
||||
android:id="@+id/liveToggleBtn"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textOff="开始拉流"
|
||||
android:textOn="停止拉流"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toLeftOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvWifiState"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="wifi State :0"
|
||||
android:textColor="#17FBF4"
|
||||
android:textSize="32px"
|
||||
android:text="wifi State :0"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent" />
|
||||
</android.support.constraint.ConstraintLayout>
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent" />
|
||||
</LinearLayout>
|
||||
1
foudations/mogo-live/libs/VERSION.txt
Normal file
1
foudations/mogo-live/libs/VERSION.txt
Normal file
@@ -0,0 +1 @@
|
||||
2.14.0.5551_stable_video
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
foudations/mogo-live/libs/x86/libZegoExpressEngine.so
Executable file
BIN
foudations/mogo-live/libs/x86/libZegoExpressEngine.so
Executable file
Binary file not shown.
BIN
foudations/mogo-live/libs/x86_64/libZegoExpressEngine.so
Executable file
BIN
foudations/mogo-live/libs/x86_64/libZegoExpressEngine.so
Executable file
Binary file not shown.
@@ -10,6 +10,7 @@ import android.app.Application;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
import android.view.SurfaceView;
|
||||
import android.view.TextureView;
|
||||
|
||||
import com.mogo.cloud.live.listener.ILiveCurrentRoomStatusListener;
|
||||
import com.mogo.cloud.live.listener.ILiveMultiRoomStatusListener;
|
||||
@@ -31,11 +32,11 @@ import im.zego.zegoexpress.ZegoExpressEngine;
|
||||
import im.zego.zegoexpress.callback.IZegoCustomVideoCaptureHandler;
|
||||
import im.zego.zegoexpress.callback.IZegoEventHandler;
|
||||
import im.zego.zegoexpress.constants.ZegoEngineState;
|
||||
import im.zego.zegoexpress.constants.ZegoLanguage;
|
||||
import im.zego.zegoexpress.constants.ZegoPlayerState;
|
||||
import im.zego.zegoexpress.constants.ZegoPublishChannel;
|
||||
import im.zego.zegoexpress.constants.ZegoPublisherState;
|
||||
import im.zego.zegoexpress.constants.ZegoRemoteDeviceState;
|
||||
import im.zego.zegoexpress.constants.ZegoRoomMode;
|
||||
import im.zego.zegoexpress.constants.ZegoRoomState;
|
||||
import im.zego.zegoexpress.constants.ZegoScenario;
|
||||
import im.zego.zegoexpress.constants.ZegoUpdateType;
|
||||
@@ -46,6 +47,9 @@ import im.zego.zegoexpress.constants.ZegoVideoFrameFormat;
|
||||
import im.zego.zegoexpress.constants.ZegoViewMode;
|
||||
import im.zego.zegoexpress.entity.ZegoCanvas;
|
||||
import im.zego.zegoexpress.entity.ZegoCustomVideoCaptureConfig;
|
||||
import im.zego.zegoexpress.entity.ZegoEngineConfig;
|
||||
import im.zego.zegoexpress.entity.ZegoEngineProfile;
|
||||
import im.zego.zegoexpress.entity.ZegoPlayerConfig;
|
||||
import im.zego.zegoexpress.entity.ZegoRoomConfig;
|
||||
import im.zego.zegoexpress.entity.ZegoUser;
|
||||
import im.zego.zegoexpress.entity.ZegoVideoConfig;
|
||||
@@ -122,6 +126,7 @@ public class MoGoLiveManager {
|
||||
*/
|
||||
private final ZegoRoomConfig zeGoRoomConfig;
|
||||
private IMediaPlayerStateListener mMediaPlayerStateListener;
|
||||
private ZegoUser zegoUserCurrent;
|
||||
|
||||
private static final class Holder {
|
||||
private static final MoGoLiveManager manager = new MoGoLiveManager();
|
||||
@@ -181,8 +186,11 @@ public class MoGoLiveManager {
|
||||
for (ILiveProgressListener iLiveProgressListener : mProgressListener) {
|
||||
iLiveProgressListener.onDebugError(errorCode, funcName, info);
|
||||
}
|
||||
// 停止推送数据
|
||||
stopPublish();
|
||||
// 是否处于发布状态
|
||||
if (mLiveStatusModel != null && mLiveStatusModel.isPushing()) {
|
||||
// 停止推送数据
|
||||
stopPublish();
|
||||
}
|
||||
}
|
||||
|
||||
// 音视频引擎状态更新回调
|
||||
@@ -465,15 +473,36 @@ public class MoGoLiveManager {
|
||||
case HTTP_DNS_ENV_DEMO:
|
||||
isTestEnv = false;
|
||||
}
|
||||
mExpressEngine = ZegoExpressEngine.createEngine(
|
||||
appId,
|
||||
appKey,
|
||||
isTestEnv,
|
||||
ZegoScenario.GENERAL,
|
||||
mApplication,
|
||||
mEventHandler);
|
||||
|
||||
// 设置房间模式为多房间模式
|
||||
ZegoExpressEngine.setRoomMode(ZegoRoomMode.MULTI_ROOM);
|
||||
|
||||
ZegoEngineConfig zegoEngineConfig = new ZegoEngineConfig();
|
||||
zegoEngineConfig.advancedConfig.put("language", "chinese");
|
||||
zegoEngineConfig.advancedConfig.put("set_verbose", MoGoAiCloudClientConfig.getInstance().isShowDebugLog() + "");
|
||||
ZegoExpressEngine.setEngineConfig(zegoEngineConfig);
|
||||
|
||||
ZegoEngineProfile profile = new ZegoEngineProfile();
|
||||
/* 请通过官网注册获取,格式为 123456789L */
|
||||
profile.appID = appId;
|
||||
/* 64个字符,请通过官网注册获取,格式为"0123456789012345678901234567890123456789012345678901234567890123" */
|
||||
profile.appSign = appKey;
|
||||
/* 通用场景接入 */
|
||||
profile.scenario = ZegoScenario.GENERAL;
|
||||
/* 设置app的application 对象 */
|
||||
profile.application = mApplication;
|
||||
/* 创建引擎 */
|
||||
mExpressEngine = ZegoExpressEngine.createEngine(profile, mEventHandler);
|
||||
|
||||
// mExpressEngine = ZegoExpressEngine.createEngine(
|
||||
// appId,
|
||||
// appKey,
|
||||
// isTestEnv,
|
||||
// ZegoScenario.GENERAL,
|
||||
// mApplication,
|
||||
// mEventHandler);
|
||||
// 关闭日志
|
||||
mExpressEngine.setDebugVerbose(MoGoAiCloudClientConfig.getInstance().isShowDebugLog(), ZegoLanguage.CHINESE);
|
||||
//mExpressEngine.setDebugVerbose(MoGoAiCloudClientConfig.getInstance().isShowDebugLog(), ZegoLanguage.CHINESE);
|
||||
// true 表示静音(关闭)
|
||||
mExpressEngine.muteMicrophone(true);
|
||||
if (mLivePushConfig != null) {
|
||||
@@ -548,8 +577,8 @@ public class MoGoLiveManager {
|
||||
+ " currentRoomId:" + mLiveStatusModel.getCurrentRoomId()
|
||||
+ " currentStreamId:" + mLiveStatusModel.getCurrentStreamId());
|
||||
if (!mLiveStatusModel.isLoginCurrentRoom()) {
|
||||
ZegoUser zegoUser = new ZegoUser(userId, NAME_PREFIX + userId);
|
||||
mExpressEngine.loginRoom(mLiveStatusModel.getCurrentRoomId(), zegoUser, zeGoRoomConfig);
|
||||
zegoUserCurrent = new ZegoUser(userId, NAME_PREFIX + userId);
|
||||
mExpressEngine.loginRoom(mLiveStatusModel.getCurrentRoomId(), zegoUserCurrent, zeGoRoomConfig);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -588,26 +617,26 @@ public class MoGoLiveManager {
|
||||
Log.i(TAG,
|
||||
"尝试进入多房间 loginMultiRoom multiRoomId : " + mLiveStatusModel.getMultiRoomId()
|
||||
+ " currentStreamId : " + mLiveStatusModel.getMultiStreamId());
|
||||
if (!mLiveStatusModel.isLoginMultiRoom()) {
|
||||
Log.i(TAG, "执行登录多房间");
|
||||
mExpressEngine.loginMultiRoom(mLiveStatusModel.getMultiRoomId(), zeGoRoomConfig);
|
||||
} else {
|
||||
Log.w(TAG, "已经登录了多房间");
|
||||
}
|
||||
// if (!mLiveStatusModel.isLoginMultiRoom()) {
|
||||
Log.i(TAG, "执行登录多房间");
|
||||
mExpressEngine.loginRoom(mLiveStatusModel.getMultiRoomId(), zegoUserCurrent, zeGoRoomConfig);
|
||||
// } else {
|
||||
// Log.w(TAG, "已经登录了多房间");
|
||||
// }
|
||||
}
|
||||
|
||||
/**
|
||||
* 退出多房间
|
||||
*/
|
||||
public synchronized void logoutMultiRoom() {
|
||||
public synchronized void logoutMultiRoom(String sn) {
|
||||
Log.i(TAG, "尝试退出多房间 logoutMultiRoom multiRoomId : " + mLiveStatusModel.getMultiRoomId());
|
||||
if (mExpressEngine != null) {
|
||||
if (mLiveStatusModel.isLoginMultiRoom()) {
|
||||
Log.i(TAG, "执行退出多房间");
|
||||
mExpressEngine.logoutRoom(mLiveStatusModel.getMultiRoomId());
|
||||
} else {
|
||||
Log.w(TAG, "还未登录多房间");
|
||||
}
|
||||
// if (mLiveStatusModel.isLoginMultiRoom()) {
|
||||
Log.i(TAG, "执行退出多房间");
|
||||
mExpressEngine.logoutRoom(ROOM_ID_PREFIX + sn);
|
||||
// } else {
|
||||
// Log.w(TAG, "还未登录多房间");
|
||||
// }
|
||||
} else {
|
||||
Log.w(TAG, "ZeGo 引擎未初始化");
|
||||
}
|
||||
@@ -667,7 +696,27 @@ public class MoGoLiveManager {
|
||||
mLiveStatusModel.getMultiStreamId().startsWith(STREAM_ID_PREFIX)) {
|
||||
ZegoCanvas zegoCanvas = new ZegoCanvas(surfaceView);
|
||||
zegoCanvas.viewMode = ZegoViewMode.SCALE_TO_FILL;
|
||||
mExpressEngine.startPlayingStream(mLiveStatusModel.getMultiStreamId(), zegoCanvas);
|
||||
|
||||
ZegoPlayerConfig config = new ZegoPlayerConfig();
|
||||
config.roomID = mLiveStatusModel.getMultiRoomId();
|
||||
|
||||
mExpressEngine.startPlayingStream(mLiveStatusModel.getMultiStreamId(), zegoCanvas, config);
|
||||
} else {
|
||||
Log.e(TAG, "直播ID有误,请重试");
|
||||
}
|
||||
}
|
||||
|
||||
public void startLive(TextureView textureView) {
|
||||
Log.i(TAG, "尝试开始播放直播 startLive multiStreamId : " + mLiveStatusModel.getMultiStreamId());
|
||||
if (!TextUtils.isEmpty(mLiveStatusModel.getMultiStreamId()) &&
|
||||
mLiveStatusModel.getMultiStreamId().startsWith(STREAM_ID_PREFIX)) {
|
||||
ZegoCanvas zegoCanvas = new ZegoCanvas(textureView);
|
||||
zegoCanvas.viewMode = ZegoViewMode.SCALE_TO_FILL;
|
||||
|
||||
ZegoPlayerConfig config = new ZegoPlayerConfig();
|
||||
config.roomID = mLiveStatusModel.getMultiRoomId();
|
||||
|
||||
mExpressEngine.startPlayingStream(mLiveStatusModel.getMultiStreamId(), zegoCanvas, config);
|
||||
} else {
|
||||
Log.e(TAG, "直播ID有误,请重试");
|
||||
}
|
||||
@@ -676,7 +725,7 @@ public class MoGoLiveManager {
|
||||
/**
|
||||
* 停止播放直播
|
||||
*/
|
||||
public void stopLive() {
|
||||
public void stopLive(String sn) {
|
||||
Log.i(TAG, "尝试停止播放直播 stopLive multiStreamId : " + mLiveStatusModel.getMultiStreamId());
|
||||
if (mExpressEngine == null) {
|
||||
Log.w(TAG, "ZeGo 引擎未初始化");
|
||||
@@ -686,7 +735,7 @@ public class MoGoLiveManager {
|
||||
mExpressEngine.stopPlayingStream(mLiveStatusModel.getMultiStreamId());
|
||||
mExpressEngine.stopPreview();
|
||||
// 退出正在查看的多房间
|
||||
logoutMultiRoom();
|
||||
logoutMultiRoom(sn);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.mogo.cloud.live.manager;
|
||||
|
||||
import com.elegant.log.simplelog.Logger;
|
||||
import com.google.gson.Gson;
|
||||
import com.mogo.cloud.live.constant.LiveConstant;
|
||||
import com.mogo.cloud.live.listener.IRequestLiveListener;
|
||||
@@ -12,7 +13,6 @@ import com.mogo.cloud.live.network.LiveApiServer;
|
||||
import com.mogo.cloud.network.NetConstants;
|
||||
import com.mogo.cloud.network.RetrofitFactory;
|
||||
import com.mogo.cloud.passport.MoGoAiCloudClient;
|
||||
import com.mogo.cloud.utils.logger.Logger;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
@@ -66,6 +66,9 @@ public class LiveStatusModel {
|
||||
}
|
||||
|
||||
public String getMultiRoomId() {
|
||||
if (multiRoomId == null) {
|
||||
return "";
|
||||
}
|
||||
return multiRoomId;
|
||||
}
|
||||
|
||||
|
||||
@@ -27,25 +27,25 @@ SNAPSHOT_REPOSITORY_URL=http://nexus.zhidaoauto.com/repository/maven-snapshots/
|
||||
USERNAME=xintai
|
||||
PASSWORD=xintai2018
|
||||
# 编译模式: false - 依赖本地版本, true - 依赖 maven 版本
|
||||
RELEASE=true
|
||||
RELEASE=false
|
||||
# AI CLOUD 云平台
|
||||
# 工具类
|
||||
MOGO_UTILS_VERSION=1.1.61-live
|
||||
MOGO_UTILS_VERSION=1.1.62-live
|
||||
# 网络请求
|
||||
MOGO_NETWORK_VERSION=1.1.61-live
|
||||
MOGO_NETWORK_VERSION=1.1.62-live
|
||||
# 网络DNS
|
||||
MOGO_HTTPDNS_VERSION=1.1.61-live
|
||||
MOGO_HTTPDNS_VERSION=1.1.62-live
|
||||
# 鉴权
|
||||
MOGO_PASSPORT_VERSION=1.1.61-live
|
||||
MOGO_PASSPORT_VERSION=1.1.62-live
|
||||
# 常链接
|
||||
MOGO_SOCKET_VERSION=1.1.61-live
|
||||
MOGO_SOCKET_VERSION=1.1.62-live
|
||||
# 数据采集
|
||||
MOGO_REALTIME_VERSION=1.1.61-live
|
||||
MOGO_REALTIME_VERSION=1.1.62-live
|
||||
# 探路,道路事件发布,获取
|
||||
MOGO_TANLU_VERSION=1.1.61-live
|
||||
MOGO_TANLU_VERSION=1.1.62-live
|
||||
# 直播推流
|
||||
MOGO_LIVE_VERSION=1.1.61-live
|
||||
MOGO_LIVE_VERSION=1.1.62-live
|
||||
# 直播拉流
|
||||
MOGO_TRAFFICLIVE_VERSION=1.1.61-live
|
||||
MOGO_TRAFFICLIVE_VERSION=1.1.62-live
|
||||
# 定位服务
|
||||
MOGO_LOCATION_VERSION=1.1.61-live
|
||||
MOGO_LOCATION_VERSION=1.1.62-live
|
||||
|
||||
@@ -33,9 +33,11 @@ dependencies {
|
||||
if (Boolean.valueOf(RELEASE)) {
|
||||
implementation "com.mogo.cloud:network:${MOGO_NETWORK_VERSION}"
|
||||
api "com.mogo.cloud:live:${MOGO_LIVE_VERSION}"
|
||||
api "com.mogo.cloud:utils:${MOGO_UTILS_VERSION}"
|
||||
} else {
|
||||
implementation project(":foudations:mogo-network")
|
||||
api project(":foudations:mogo-live")
|
||||
api project(':foudations:mogo-utils')
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -142,7 +142,7 @@ public class TrafficLiveCurrentManager
|
||||
}
|
||||
}
|
||||
});
|
||||
MoGoLiveManager.getInstance().stopLive();
|
||||
MoGoLiveManager.getInstance().stopLive(liveSn);
|
||||
trafficLiveCallBack = null;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user