add new func of live module and realTime add new field
This commit is contained in:
@@ -53,10 +53,30 @@ public class CloudLocationInfo implements Parcelable {
|
||||
*/
|
||||
private int vehicleType = 0;
|
||||
|
||||
/**
|
||||
* 道路ID
|
||||
*/
|
||||
private String roadId;
|
||||
|
||||
/**
|
||||
* 车道ID-2D路段
|
||||
*/
|
||||
private String laneId;
|
||||
|
||||
/**
|
||||
* 车道号:中心线编号为0,中心线右侧编号为负数,3车道通行Road的车道编号,0,-1,-2,-3
|
||||
*/
|
||||
private int laneNum;
|
||||
|
||||
/**
|
||||
* 限速
|
||||
*/
|
||||
private double rateLimiting;
|
||||
|
||||
public CloudLocationInfo() {
|
||||
}
|
||||
|
||||
public CloudLocationInfo(CloudLocationInfo info ) {
|
||||
public CloudLocationInfo(CloudLocationInfo info) {
|
||||
this.lat = info.getLat();
|
||||
this.lon = info.getLon();
|
||||
this.heading = info.getHeading();
|
||||
@@ -65,9 +85,13 @@ public class CloudLocationInfo implements Parcelable {
|
||||
this.alt = info.alt;
|
||||
this.speed = info.speed;
|
||||
this.vehicleType = info.vehicleType;
|
||||
this.roadId = info.roadId;
|
||||
this.laneId = info.laneId;
|
||||
this.laneNum = info.laneNum;
|
||||
this.rateLimiting = info.rateLimiting;
|
||||
}
|
||||
|
||||
protected CloudLocationInfo(Parcel in ) {
|
||||
protected CloudLocationInfo(Parcel in) {
|
||||
lat = in.readDouble();
|
||||
lon = in.readDouble();
|
||||
heading = in.readDouble();
|
||||
@@ -76,18 +100,26 @@ public class CloudLocationInfo implements Parcelable {
|
||||
alt = in.readDouble();
|
||||
speed = in.readDouble();
|
||||
vehicleType = in.readInt();
|
||||
roadId = in.readString();
|
||||
laneId = in.readString();
|
||||
laneNum = in.readInt();
|
||||
rateLimiting = in.readDouble();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToParcel( Parcel dest, int flags ) {
|
||||
dest.writeDouble( lat );
|
||||
dest.writeDouble( lon );
|
||||
dest.writeDouble( heading );
|
||||
dest.writeLong( systemTime );
|
||||
dest.writeLong( satelliteTime );
|
||||
dest.writeDouble( alt );
|
||||
dest.writeDouble( speed );
|
||||
dest.writeInt( vehicleType );
|
||||
public void writeToParcel(Parcel dest, int flags) {
|
||||
dest.writeDouble(lat);
|
||||
dest.writeDouble(lon);
|
||||
dest.writeDouble(heading);
|
||||
dest.writeLong(systemTime);
|
||||
dest.writeLong(satelliteTime);
|
||||
dest.writeDouble(alt);
|
||||
dest.writeDouble(speed);
|
||||
dest.writeInt(vehicleType);
|
||||
dest.writeString(roadId);
|
||||
dest.writeString(laneId);
|
||||
dest.writeInt(laneNum);
|
||||
dest.writeDouble(rateLimiting);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -95,14 +127,14 @@ public class CloudLocationInfo implements Parcelable {
|
||||
return 0;
|
||||
}
|
||||
|
||||
public static final Creator< CloudLocationInfo > CREATOR = new Creator< CloudLocationInfo >() {
|
||||
public static final Creator<CloudLocationInfo> CREATOR = new Creator<CloudLocationInfo>() {
|
||||
@Override
|
||||
public CloudLocationInfo createFromParcel( Parcel in ) {
|
||||
return new CloudLocationInfo( in );
|
||||
public CloudLocationInfo createFromParcel(Parcel in) {
|
||||
return new CloudLocationInfo(in);
|
||||
}
|
||||
|
||||
@Override
|
||||
public CloudLocationInfo[] newArray( int size ) {
|
||||
public CloudLocationInfo[] newArray(int size) {
|
||||
return new CloudLocationInfo[size];
|
||||
}
|
||||
};
|
||||
@@ -111,7 +143,7 @@ public class CloudLocationInfo implements Parcelable {
|
||||
return lat;
|
||||
}
|
||||
|
||||
public void setLat( double lat ) {
|
||||
public void setLat(double lat) {
|
||||
this.lat = lat;
|
||||
}
|
||||
|
||||
@@ -119,7 +151,7 @@ public class CloudLocationInfo implements Parcelable {
|
||||
return lon;
|
||||
}
|
||||
|
||||
public void setLon( double lon ) {
|
||||
public void setLon(double lon) {
|
||||
this.lon = lon;
|
||||
}
|
||||
|
||||
@@ -127,7 +159,7 @@ public class CloudLocationInfo implements Parcelable {
|
||||
return heading;
|
||||
}
|
||||
|
||||
public void setHeading( double heading ) {
|
||||
public void setHeading(double heading) {
|
||||
this.heading = heading;
|
||||
}
|
||||
|
||||
@@ -135,7 +167,7 @@ public class CloudLocationInfo implements Parcelable {
|
||||
return systemTime;
|
||||
}
|
||||
|
||||
public void setSystemTime( long systemTime ) {
|
||||
public void setSystemTime(long systemTime) {
|
||||
this.systemTime = systemTime;
|
||||
}
|
||||
|
||||
@@ -143,7 +175,7 @@ public class CloudLocationInfo implements Parcelable {
|
||||
return satelliteTime;
|
||||
}
|
||||
|
||||
public void setSatelliteTime( long satelliteTime ) {
|
||||
public void setSatelliteTime(long satelliteTime) {
|
||||
this.satelliteTime = satelliteTime;
|
||||
}
|
||||
|
||||
@@ -151,7 +183,7 @@ public class CloudLocationInfo implements Parcelable {
|
||||
return alt;
|
||||
}
|
||||
|
||||
public void setAlt( double alt ) {
|
||||
public void setAlt(double alt) {
|
||||
this.alt = alt;
|
||||
}
|
||||
|
||||
@@ -159,7 +191,7 @@ public class CloudLocationInfo implements Parcelable {
|
||||
return speed;
|
||||
}
|
||||
|
||||
public void setSpeed( double speed ) {
|
||||
public void setSpeed(double speed) {
|
||||
this.speed = speed;
|
||||
}
|
||||
|
||||
@@ -171,6 +203,38 @@ public class CloudLocationInfo implements Parcelable {
|
||||
this.vehicleType = vehicleType;
|
||||
}
|
||||
|
||||
public String getRoadId() {
|
||||
return roadId;
|
||||
}
|
||||
|
||||
public void setRoadId(String roadId) {
|
||||
this.roadId = roadId;
|
||||
}
|
||||
|
||||
public String getLaneId() {
|
||||
return laneId;
|
||||
}
|
||||
|
||||
public void setLaneId(String laneId) {
|
||||
this.laneId = laneId;
|
||||
}
|
||||
|
||||
public int getLaneNum() {
|
||||
return laneNum;
|
||||
}
|
||||
|
||||
public void setLaneNum(int laneNum) {
|
||||
this.laneNum = laneNum;
|
||||
}
|
||||
|
||||
public double getRateLimiting() {
|
||||
return rateLimiting;
|
||||
}
|
||||
|
||||
public void setRateLimiting(double rateLimiting) {
|
||||
this.rateLimiting = rateLimiting;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "CloudLocationInfo{" +
|
||||
@@ -182,6 +246,10 @@ public class CloudLocationInfo implements Parcelable {
|
||||
", alt=" + alt +
|
||||
", speed=" + speed +
|
||||
", vehicleType=" + vehicleType +
|
||||
", roadId='" + roadId + '\'' +
|
||||
", laneId='" + laneId + '\'' +
|
||||
", laneNum=" + laneNum +
|
||||
", rateLimiting=" + rateLimiting +
|
||||
'}';
|
||||
}
|
||||
|
||||
@@ -191,21 +259,21 @@ public class CloudLocationInfo implements Parcelable {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals( Object o ) {
|
||||
if ( this == o ) {
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if ( o == null || getClass() != o.getClass() ) {
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
CloudLocationInfo that = ( CloudLocationInfo ) o;
|
||||
return Double.compare( that.lat, lat ) == 0 &&
|
||||
Double.compare( that.lon, lon ) == 0;
|
||||
CloudLocationInfo that = (CloudLocationInfo) o;
|
||||
return Double.compare(that.lat, lat) == 0 &&
|
||||
Double.compare(that.lon, lon) == 0;
|
||||
}
|
||||
|
||||
@RequiresApi(api = Build.VERSION_CODES.KITKAT)
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash( lat, lon );
|
||||
return Objects.hash(lat, lon);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
-keep class com.mogo.cloud.trafficlive.api.ITrafficLiveCallBack{*;}
|
||||
-keep class com.mogo.cloud.trafficlive.api.ITrafficCarLiveCallBack{*;}
|
||||
-keep class com.mogo.cloud.trafficlive.api.MoGoAiCloudTrafficLive{*;}
|
||||
@@ -1,6 +1,6 @@
|
||||
package com.mogo.cloud.trafficlive.api;
|
||||
|
||||
public interface ITrafficLiveCallBack {
|
||||
public interface ITrafficCarLiveCallBack {
|
||||
|
||||
|
||||
default void onLiveConnecting() {
|
||||
@@ -0,0 +1,8 @@
|
||||
package com.mogo.cloud.trafficlive.api;
|
||||
|
||||
public interface ITrafficIntersectionLiveCallBack {
|
||||
|
||||
void liveUrlResult(String liveUrl);
|
||||
|
||||
void onError(String errorMsg);
|
||||
}
|
||||
@@ -1,6 +1,5 @@
|
||||
package com.mogo.cloud.trafficlive.api;
|
||||
|
||||
import android.app.Application;
|
||||
import android.view.SurfaceView;
|
||||
|
||||
import com.mogo.cloud.trafficlive.core.TrafficLiveCurrentManager;
|
||||
@@ -11,37 +10,92 @@ import static com.mogo.cloud.trafficlive.constant.TrafficLiveConstant.TAG;
|
||||
public class MoGoAiCloudTrafficLive {
|
||||
|
||||
/**
|
||||
* 查看指定SN车辆直播
|
||||
* 查看前方车辆直播
|
||||
*
|
||||
* @param lat 纬度
|
||||
* @param lon 经度
|
||||
* @param bearing 方向角
|
||||
* @param surfaceView 直播界面
|
||||
* @param callBack {@link ITrafficCarLiveCallBack}直播回调
|
||||
*/
|
||||
public static void viewVehicleHeadLive(Application application, String liveSn, SurfaceView surfaceView, ITrafficLiveCallBack callBack) {
|
||||
public static void viewFrontVehicleLive(double lat, double lon, int bearing, SurfaceView surfaceView, ITrafficCarLiveCallBack callBack) {
|
||||
try {
|
||||
TrafficLiveCurrentManager.getInstance().viewVehicleHeadLive(application, liveSn, surfaceView, callBack);
|
||||
TrafficLiveCurrentManager.getInstance().viewFrontVehicleLive(lat, lon, bearing, surfaceView, callBack);
|
||||
} catch (Exception e) {
|
||||
Logger.e(TAG, " viewVehicleHeadLive error : " + e);
|
||||
Logger.e(TAG, " viewFrontVehicleLive error : " + e);
|
||||
callBack.onError(e != null ? e.getMessage() : "check input param");
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 查看指定SN车辆直播
|
||||
*
|
||||
* @param liveSn 直播车辆SN
|
||||
* @param surfaceView 直播界面
|
||||
* @param callBack {@link ITrafficCarLiveCallBack}直播回调
|
||||
*/
|
||||
public static void viewDesignativeVehicleLive(String liveSn, SurfaceView surfaceView, ITrafficCarLiveCallBack callBack) {
|
||||
try {
|
||||
TrafficLiveCurrentManager.getInstance().viewDesignativeVehicleLive(liveSn, surfaceView, callBack);
|
||||
} catch (Exception e) {
|
||||
Logger.e(TAG, " viewDesignativeVehicleLive error : " + e);
|
||||
callBack.onError(e != null ? e.getMessage() : "check input param");
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 查看前方路口直播
|
||||
*
|
||||
* @param lat 纬度
|
||||
* @param lon 经度
|
||||
* @param bearing 方向角
|
||||
* @param callBack {@link ITrafficIntersectionLiveCallBack}直播回调
|
||||
*/
|
||||
public static void viewIntersectionLive(ITrafficLiveCallBack callBack) {
|
||||
TrafficLiveCurrentManager.getInstance().viewIntersectionLive(callBack);
|
||||
public static void viewFrontIntersectionLive(double lat, double lon, int bearing, ITrafficIntersectionLiveCallBack callBack) {
|
||||
try {
|
||||
TrafficLiveCurrentManager.getInstance().viewFrontIntersectionLive(lat, lon, bearing, callBack);
|
||||
} catch (Exception e) {
|
||||
Logger.e(TAG, " viewFrontIntersectionLive error : " + e);
|
||||
callBack.onError(e != null ? e.getMessage() : "check input param");
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 停止观看直播
|
||||
* 查看指定路口摄像头直播
|
||||
*
|
||||
* @param cameraId 设备id
|
||||
* @param lat 纬度
|
||||
* @param lon 经度
|
||||
* @param callBack {@link ITrafficIntersectionLiveCallBack}直播回调
|
||||
*/
|
||||
public static void stopLive(String liveSn) {
|
||||
TrafficLiveCurrentManager.getInstance().stopLive(liveSn);
|
||||
public static void viewDesignativeIntersectionLive(int cameraId, double lat, double lon, ITrafficIntersectionLiveCallBack callBack) {
|
||||
try {
|
||||
TrafficLiveCurrentManager.getInstance().viewDesignativeIntersectionLive(cameraId, lat, lon, callBack);
|
||||
} catch (Exception e) {
|
||||
Logger.e(TAG, " viewDesignativeIntersectionLive error : " + e);
|
||||
callBack.onError(e != null ? e.getMessage() : "check input param");
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 是否在直播中
|
||||
* 停止观看车辆直播
|
||||
*
|
||||
* @param liveSn 车辆SN
|
||||
*/
|
||||
public static void stopCarLive(String liveSn) {
|
||||
TrafficLiveCurrentManager.getInstance().stopCarLive(liveSn);
|
||||
}
|
||||
|
||||
/**
|
||||
* 车辆是否在直播中
|
||||
*
|
||||
* @return 直播状态
|
||||
*/
|
||||
public static boolean isOnLive() {
|
||||
return TrafficLiveCurrentManager.getInstance().isOnLive();
|
||||
public static boolean isCarOnLive() {
|
||||
return TrafficLiveCurrentManager.getInstance().isCarOnLive();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
package com.mogo.cloud.trafficlive.core;
|
||||
|
||||
import android.app.Application;
|
||||
import android.os.SystemClock;
|
||||
import android.text.TextUtils;
|
||||
import android.view.SurfaceView;
|
||||
|
||||
@@ -12,7 +10,8 @@ import com.mogo.cloud.live.manager.MoGoLiveManager;
|
||||
import com.mogo.cloud.live.manager.MoGoLivePushConfig;
|
||||
import com.mogo.cloud.live.manager.RequestLiveManager;
|
||||
import com.mogo.cloud.passport.MoGoAiCloudClient;
|
||||
import com.mogo.cloud.trafficlive.api.ITrafficLiveCallBack;
|
||||
import com.mogo.cloud.trafficlive.api.ITrafficCarLiveCallBack;
|
||||
import com.mogo.cloud.trafficlive.api.ITrafficIntersectionLiveCallBack;
|
||||
import com.mogo.cloud.utils.logger.Logger;
|
||||
|
||||
import static com.mogo.cloud.live.constant.LiveConstant.LIVE_TYPE_CLOSE;
|
||||
@@ -24,10 +23,7 @@ public class TrafficLiveCurrentManager
|
||||
|
||||
private static volatile TrafficLiveCurrentManager mInstance;
|
||||
private final RequestLiveManager requestLiveManager;
|
||||
private ITrafficLiveCallBack trafficLiveCallBack;
|
||||
private SurfaceView surfaceView;
|
||||
private String mStreamId;
|
||||
private boolean isLoginSuccess = false;
|
||||
private ITrafficCarLiveCallBack trafficLiveCallBack;
|
||||
|
||||
private TrafficLiveCurrentManager() {
|
||||
requestLiveManager = RequestLiveManager.getInstance();
|
||||
@@ -45,12 +41,40 @@ public class TrafficLiveCurrentManager
|
||||
return mInstance;
|
||||
}
|
||||
|
||||
public boolean isOnLive() {
|
||||
public boolean isCarOnLive() {
|
||||
return MoGoLiveManager.getInstance().getLiveStatusModel().isPlaying();
|
||||
}
|
||||
|
||||
public void viewVehicleHeadLive(Application application, String liveSn, SurfaceView surfaceView, ITrafficLiveCallBack trafficLiveCallBack) throws Exception {
|
||||
if (trafficLiveCallBack == null) {
|
||||
public void viewFrontVehicleLive(double lat, double lon, int bearing, SurfaceView surfaceView, ITrafficCarLiveCallBack callBack) throws Exception {
|
||||
if (callBack == null) {
|
||||
throw new Exception("ITrafficLiveCallBack can not be null");
|
||||
}
|
||||
if (surfaceView == null) {
|
||||
throw new Exception("SurfaceView can not be null");
|
||||
}
|
||||
if (lat == 0.0 || lon == 0.0) {
|
||||
throw new Exception("param lat and lon can not be 0.0f");
|
||||
}
|
||||
if (bearing < 0) {
|
||||
throw new Exception("param bearing can not less than 0");
|
||||
}
|
||||
|
||||
this.trafficLiveCallBack = callBack;
|
||||
requestLiveManager.requestFrontVehicleLive(lat, lon, bearing, new IRequestLiveListener() {
|
||||
@Override
|
||||
public void onSuccess(String liveSn, String liveUrl, double lat, double lon) {
|
||||
onVehicleLiveSuccess(liveSn, surfaceView);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Throwable e) {
|
||||
onVehicleLiveError(e.getMessage());
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void viewDesignativeVehicleLive(String liveSn, SurfaceView surfaceView, ITrafficCarLiveCallBack callBack) throws Exception {
|
||||
if (callBack == null) {
|
||||
throw new Exception("ITrafficLiveCallBack can not be null");
|
||||
}
|
||||
if (surfaceView == null) {
|
||||
@@ -60,45 +84,42 @@ public class TrafficLiveCurrentManager
|
||||
throw new Exception("liveSn can not be null");
|
||||
}
|
||||
|
||||
this.trafficLiveCallBack = trafficLiveCallBack;
|
||||
this.surfaceView = surfaceView;
|
||||
Logger.i(TAG, "申请拉流 systemClock :" + SystemClock.elapsedRealtime() + " SystemTime : " + System.currentTimeMillis());
|
||||
requestLiveManager.requestVehicleHeadLive(LIVE_TYPE_OPEN, liveSn, new IRequestLiveListener() {
|
||||
this.trafficLiveCallBack = callBack;
|
||||
requestLiveManager.requestDesignativeVehicleLive(LIVE_TYPE_OPEN, liveSn, new IRequestLiveListener() {
|
||||
@Override
|
||||
public void onSuccess() {
|
||||
Logger.i(TAG, "主播开始直播了 systemClock :" + SystemClock.elapsedRealtime() + " SystemTime : " + System.currentTimeMillis());
|
||||
String sn = MoGoAiCloudClient.getInstance().getAiCloudClientConfig().getSn();
|
||||
mStreamId = MoGoLiveManager.STREAM_ID_PREFIX + liveSn;
|
||||
|
||||
// 初始化配置文件
|
||||
MoGoLivePushConfig mLivePushConfig = MoGoLivePushConfig.getInstance();
|
||||
mLivePushConfig.setDevicesId(sn);
|
||||
|
||||
// 登录要查看的SN房间
|
||||
MoGoLiveManager.getInstance().loginMultiRoom(liveSn);
|
||||
|
||||
// 直接 查看对应SN的直播
|
||||
MoGoLiveManager.getInstance().startLive(surfaceView);
|
||||
if (TrafficLiveCurrentManager.this.trafficLiveCallBack != null) {
|
||||
TrafficLiveCurrentManager.this.trafficLiveCallBack.onLive();
|
||||
}
|
||||
onVehicleLiveSuccess(liveSn, surfaceView);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Throwable e) {
|
||||
if (TrafficLiveCurrentManager.this.trafficLiveCallBack != null) {
|
||||
TrafficLiveCurrentManager.this.trafficLiveCallBack.onError(e.getMessage());
|
||||
}
|
||||
onVehicleLiveError(e.getMessage());
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void viewIntersectionLive(ITrafficLiveCallBack callBack) {
|
||||
|
||||
private void onVehicleLiveSuccess(String liveSn, SurfaceView surfaceView) {
|
||||
String sn = MoGoAiCloudClient.getInstance().getAiCloudClientConfig().getSn();
|
||||
// 初始化配置文件
|
||||
MoGoLivePushConfig mLivePushConfig = MoGoLivePushConfig.getInstance();
|
||||
mLivePushConfig.setDevicesId(sn);
|
||||
// 登录要查看的SN房间
|
||||
MoGoLiveManager.getInstance().loginMultiRoom(liveSn);
|
||||
// 直接 查看对应SN的直播
|
||||
MoGoLiveManager.getInstance().startLive(surfaceView);
|
||||
if (TrafficLiveCurrentManager.this.trafficLiveCallBack != null) {
|
||||
TrafficLiveCurrentManager.this.trafficLiveCallBack.onLive();
|
||||
}
|
||||
}
|
||||
|
||||
public void stopLive(String liveSn) {
|
||||
requestLiveManager.requestVehicleHeadLive(LIVE_TYPE_CLOSE, liveSn, new IRequestLiveListener() {
|
||||
private void onVehicleLiveError(String errorMsg) {
|
||||
if (TrafficLiveCurrentManager.this.trafficLiveCallBack != null) {
|
||||
TrafficLiveCurrentManager.this.trafficLiveCallBack.onError(errorMsg);
|
||||
}
|
||||
}
|
||||
|
||||
public void stopCarLive(String liveSn) {
|
||||
requestLiveManager.requestDesignativeVehicleLive(LIVE_TYPE_CLOSE, liveSn, new IRequestLiveListener() {
|
||||
@Override
|
||||
public void onSuccess() {
|
||||
}
|
||||
@@ -111,10 +132,47 @@ public class TrafficLiveCurrentManager
|
||||
}
|
||||
});
|
||||
MoGoLiveManager.getInstance().stopLive();
|
||||
surfaceView = null;
|
||||
trafficLiveCallBack = null;
|
||||
isLoginSuccess = false;
|
||||
mStreamId = null;
|
||||
}
|
||||
|
||||
public void viewFrontIntersectionLive(double lat, double lon, int bearing, ITrafficIntersectionLiveCallBack callBack) throws Exception {
|
||||
if (lat == 0.0 || lon == 0.0) {
|
||||
throw new Exception("param lat and lon can not be 0.0f");
|
||||
}
|
||||
if (bearing < 0) {
|
||||
throw new Exception("param bearing can not less than 0");
|
||||
}
|
||||
requestLiveManager.requestFrontIntersectionLive(lat, lon, bearing, new IRequestLiveListener() {
|
||||
@Override
|
||||
public void onSuccess(String liveUrl) {
|
||||
callBack.liveUrlResult(liveUrl);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Throwable e) {
|
||||
callBack.onError(e.getMessage());
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void viewDesignativeIntersectionLive(int cameraId, double lat, double lon, ITrafficIntersectionLiveCallBack callBack) throws Exception {
|
||||
if (lat == 0.0 || lon == 0.0) {
|
||||
throw new Exception("param lat and lon can not be 0.0f");
|
||||
}
|
||||
if (cameraId < 0) {
|
||||
throw new Exception("param bearing can not less than 0");
|
||||
}
|
||||
requestLiveManager.requestDesignativeIntersectionLive(cameraId, lat, lon, new IRequestLiveListener() {
|
||||
@Override
|
||||
public void onSuccess(String liveUrl) {
|
||||
callBack.liveUrlResult(liveUrl);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Throwable e) {
|
||||
callBack.onError(e.getMessage());
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -135,7 +193,6 @@ public class TrafficLiveCurrentManager
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onMultiRoomConnecting() {
|
||||
if (trafficLiveCallBack != null) {
|
||||
@@ -145,7 +202,6 @@ public class TrafficLiveCurrentManager
|
||||
|
||||
@Override
|
||||
public void onMultiRoomConnected() {
|
||||
isLoginSuccess = true;
|
||||
if (trafficLiveCallBack != null) {
|
||||
trafficLiveCallBack.onLiveConnected();
|
||||
}
|
||||
@@ -153,9 +209,9 @@ public class TrafficLiveCurrentManager
|
||||
|
||||
@Override
|
||||
public void onMultiRoomDisconnected() {
|
||||
isLoginSuccess = false;
|
||||
if (trafficLiveCallBack != null) {
|
||||
trafficLiveCallBack.onDisConnect();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user