Merge branch 'fix_loginMultiRoom_bug'
# Conflicts: # app/src/main/java/com/mogo/cloud/LivePlayActivity.java # app/src/main/java/com/mogo/cloud/MoGoApplication.java # app/src/main/res/layout/activity_live_play.xml # foudations/mogo-live/src/main/java/com/mogo/cloud/live/manager/RequestLiveManager.java # gradle.properties
This commit is contained in:
@@ -21,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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user