fix bug
This commit is contained in:
15
.idea/codeStyles/Project.xml
generated
15
.idea/codeStyles/Project.xml
generated
@@ -3,18 +3,9 @@
|
||||
<JetCodeStyleSettings>
|
||||
<option name="PACKAGES_TO_USE_STAR_IMPORTS">
|
||||
<value>
|
||||
<package name="java.util" alias="false" withSubpackages="false" />
|
||||
<package name="kotlinx.android.synthetic" alias="false" withSubpackages="true" />
|
||||
<package name="io.ktor" alias="false" withSubpackages="true" />
|
||||
</value>
|
||||
</option>
|
||||
<option name="PACKAGES_IMPORT_LAYOUT">
|
||||
<value>
|
||||
<package name="" alias="false" withSubpackages="true" />
|
||||
<package name="java" alias="false" withSubpackages="true" />
|
||||
<package name="javax" alias="false" withSubpackages="true" />
|
||||
<package name="kotlin" alias="false" withSubpackages="true" />
|
||||
<package name="" alias="true" withSubpackages="true" />
|
||||
<package name="java.util" withSubpackages="false" static="false" />
|
||||
<package name="kotlinx.android.synthetic" withSubpackages="true" static="false" />
|
||||
<package name="io.ktor" withSubpackages="true" static="false" />
|
||||
</value>
|
||||
</option>
|
||||
<option name="CODE_STYLE_DEFAULTS" value="KOTLIN_OFFICIAL" />
|
||||
|
||||
@@ -92,10 +92,10 @@ public class MainActivity extends AppCompatActivity {
|
||||
|
||||
btnRequestXINGLive = findViewById(R.id.btnRequestXINGLive);
|
||||
btnRequestXINGLive.setOnClickListener(v -> {
|
||||
MoGoAiCloudTrafficLive.viewDesignativeIntersectionLive("POLE1617103029423", new ITrafficIntersectionLiveCallBack() {
|
||||
MoGoAiCloudTrafficLive.viewDesignativeIntersectionLive("556834859_trafficcamera_100514_89", new ITrafficIntersectionLiveCallBack() {
|
||||
@Override
|
||||
public void liveUrlResult(String liveUrl) {
|
||||
Logger.d(TAG, "liveUrl : " + liveUrl);
|
||||
Logger.i(TAG, "liveUrl : " + liveUrl);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -103,6 +103,17 @@ public class MainActivity extends AppCompatActivity {
|
||||
Logger.e(TAG, "errorMsg : " + errorMsg);
|
||||
}
|
||||
});
|
||||
// MoGoAiCloudTrafficLive.viewDesignativeIntersectionLive("POLE1617103029423", new ITrafficIntersectionLiveCallBack() {
|
||||
// @Override
|
||||
// public void liveUrlResult(String liveUrl) {
|
||||
// Logger.d(TAG, "liveUrl : " + liveUrl);
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void onError(String errorMsg) {
|
||||
// Logger.e(TAG, "errorMsg : " + errorMsg);
|
||||
// }
|
||||
// });
|
||||
// MoGoAiCloudTrafficLive.viewFrontIntersectionLive(40.11547, 116.22544, 60, new ITrafficIntersectionLiveCallBack() {
|
||||
// @Override
|
||||
// public void liveUrlResult(String liveUrl) {
|
||||
|
||||
@@ -4,9 +4,10 @@ import com.google.gson.Gson;
|
||||
import com.mogo.cloud.live.constant.LiveConstant;
|
||||
import com.mogo.cloud.live.listener.IRequestLiveListener;
|
||||
import com.mogo.cloud.live.model.BaseData;
|
||||
import com.mogo.cloud.live.model.Camera;
|
||||
import com.mogo.cloud.live.model.LiveCamera;
|
||||
import com.mogo.cloud.live.model.LivePush;
|
||||
import com.mogo.cloud.live.model.LiveReceive;
|
||||
import com.mogo.cloud.live.model.Camera;
|
||||
import com.mogo.cloud.live.network.LiveApiServer;
|
||||
import com.mogo.cloud.network.NetConstants;
|
||||
import com.mogo.cloud.network.RetrofitFactory;
|
||||
@@ -127,7 +128,7 @@ public class RequestLiveManager {
|
||||
} else {
|
||||
requestLiveListener.onError(new Throwable("前方暂无可直播车机"));
|
||||
}
|
||||
}else {
|
||||
} else {
|
||||
requestLiveListener.onError(new Throwable("前方暂无可直播车机"));
|
||||
}
|
||||
}
|
||||
@@ -180,7 +181,7 @@ public class RequestLiveManager {
|
||||
} else {
|
||||
requestLiveListener.onError(new Throwable("前方路口暂无可直播设备"));
|
||||
}
|
||||
}else{
|
||||
} else {
|
||||
requestLiveListener.onError(new Throwable("前方路口暂无可直播设备"));
|
||||
}
|
||||
}
|
||||
@@ -214,22 +215,23 @@ public class RequestLiveManager {
|
||||
liveApiServer.getDesignativeIntersectionLive(map)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new Observer<BaseData<Camera>>() {
|
||||
.subscribe(new Observer<BaseData<LiveCamera>>() {
|
||||
@Override
|
||||
public void onSubscribe(@NonNull Disposable d) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(@NonNull BaseData<Camera> baseData) {
|
||||
public void onNext(@NonNull BaseData<LiveCamera> baseData) {
|
||||
if (requestLiveListener != null && baseData != null) {
|
||||
Camera camera = baseData.result;
|
||||
if (camera != null && camera.getRtmpUrl() != null) {
|
||||
requestLiveListener.onSuccess(camera.getRtmpUrl());
|
||||
} else {
|
||||
LiveCamera liveData = baseData.result;
|
||||
if (liveData == null || liveData.getCamera() == null || liveData.getCamera().getRtmpUrl() == null) {
|
||||
requestLiveListener.onError(new Throwable("此路口摄像头暂无直播流"));
|
||||
return;
|
||||
}
|
||||
}else{
|
||||
Camera camera = liveData.getCamera();
|
||||
requestLiveListener.onSuccess(camera.getRtmpUrl());
|
||||
} else {
|
||||
requestLiveListener.onError(new Throwable("此路口摄像头暂无直播流"));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,44 +2,17 @@ package com.mogo.cloud.live.model;
|
||||
|
||||
public class Camera {
|
||||
|
||||
/**
|
||||
* 摄像头id
|
||||
*/
|
||||
private int id;
|
||||
|
||||
/**
|
||||
* 纬度
|
||||
*/
|
||||
private double id;
|
||||
private String lat;
|
||||
|
||||
/**
|
||||
* 经度
|
||||
*/
|
||||
private String lon;
|
||||
|
||||
/**
|
||||
* 直播Url
|
||||
*/
|
||||
private String rtmpUrl;
|
||||
|
||||
/**
|
||||
* 摄像头状态
|
||||
*/
|
||||
private String state;
|
||||
|
||||
public Camera(int id, String lat, String lon, String rtmpUrl, String state) {
|
||||
this.id = id;
|
||||
this.lat = lat;
|
||||
this.lon = lon;
|
||||
this.rtmpUrl = rtmpUrl;
|
||||
this.state = state;
|
||||
}
|
||||
|
||||
public int getId() {
|
||||
public double getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(int id) {
|
||||
public void setId(double id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
package com.mogo.cloud.live.model;
|
||||
|
||||
public class LiveCamera {
|
||||
|
||||
private Camera camera;
|
||||
|
||||
public Camera getCamera() {
|
||||
return camera;
|
||||
}
|
||||
|
||||
public void setCamera(Camera camera) {
|
||||
this.camera = camera;
|
||||
}
|
||||
}
|
||||
@@ -1,8 +1,9 @@
|
||||
package com.mogo.cloud.live.network;
|
||||
|
||||
import com.mogo.cloud.live.model.BaseData;
|
||||
import com.mogo.cloud.live.model.LiveReceive;
|
||||
import com.mogo.cloud.live.model.Camera;
|
||||
import com.mogo.cloud.live.model.LiveCamera;
|
||||
import com.mogo.cloud.live.model.LiveReceive;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
@@ -55,7 +56,7 @@ public interface LiveApiServer {
|
||||
* @return {@link BaseData}
|
||||
*/
|
||||
@GET("mec-etl-server/device/unit/camera/live")
|
||||
Observable<BaseData<Camera>> getDesignativeIntersectionLive(@QueryMap Map<String, Object> parameters);
|
||||
Observable<BaseData<LiveCamera>> getDesignativeIntersectionLive(@QueryMap Map<String, Object> parameters);
|
||||
|
||||
/**
|
||||
* 上传摄像头状态
|
||||
|
||||
@@ -27,23 +27,23 @@ 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.0.81
|
||||
MOGO_UTILS_VERSION=1.0.82
|
||||
# 网络请求
|
||||
MOGO_NETWORK_VERSION=1.0.81
|
||||
MOGO_NETWORK_VERSION=1.0.82
|
||||
# 网络DNS
|
||||
MOGO_HTTPDNS_VERSION=1.0.81
|
||||
MOGO_HTTPDNS_VERSION=1.0.82
|
||||
# 鉴权
|
||||
MOGO_PASSPORT_VERSION=1.0.81
|
||||
MOGO_PASSPORT_VERSION=1.0.82
|
||||
# 常链接
|
||||
MOGO_SOCKET_VERSION=1.0.81
|
||||
MOGO_SOCKET_VERSION=1.0.82
|
||||
# 数据采集
|
||||
MOGO_REALTIME_VERSION=1.0.81
|
||||
MOGO_REALTIME_VERSION=1.0.82
|
||||
# 探路,道路事件发布,获取
|
||||
MOGO_TANLU_VERSION=1.0.81
|
||||
MOGO_TANLU_VERSION=1.0.82
|
||||
# 直播推流
|
||||
MOGO_LIVE_VERSION=1.0.81
|
||||
MOGO_LIVE_VERSION=1.0.82
|
||||
# 直播拉流
|
||||
MOGO_TRAFFICLIVE_VERSION=1.0.81
|
||||
MOGO_TRAFFICLIVE_VERSION=1.0.82
|
||||
|
||||
Reference in New Issue
Block a user