Merge branch 'dev_merge_shunyi_vr_map' of gitlab.zhidaoauto.com:ecos/yycp-service/Launcher into dev_merge_shunyi_vr_map
This commit is contained in:
@@ -34,7 +34,6 @@ public class EntranceProvider implements IMogoModuleProvider {
|
||||
public Fragment createFragment( Context context, Bundle data ) {
|
||||
mFragment = new EntranceFragment();
|
||||
mFragment.setArguments( data );
|
||||
Log.d("liyz", " createFragment ------> ");
|
||||
ExtensionServiceManager.init(context);
|
||||
return mFragment;
|
||||
}
|
||||
@@ -77,7 +76,6 @@ public class EntranceProvider implements IMogoModuleProvider {
|
||||
|
||||
@Override
|
||||
public void init( Context context ) {
|
||||
Log.d("liyz", " EntranceProvider init ------> ");
|
||||
ExtensionServiceManager.init(context);
|
||||
}
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@ import com.tencent.rtmp.ui.TXCloudVideoView;
|
||||
* V2XLiveGSYVideoView
|
||||
*/
|
||||
public class CameraLiveGSYVideoView extends LiveRoundLayout implements IMogoSkinCompatSupportable {
|
||||
private static final String TAG = "CameraLiveGSYVideoView";
|
||||
private static final String TAG = "liyz";
|
||||
|
||||
private TXCloudVideoView mTxcVideoView;
|
||||
private ProgressBar mLoading;
|
||||
@@ -150,6 +150,7 @@ public class CameraLiveGSYVideoView extends LiveRoundLayout implements IMogoSkin
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
Logger.w(TAG, "播放器:onNetStatus e = " + e);
|
||||
mLoading.setVisibility(GONE);
|
||||
mClLoadError.setVisibility(VISIBLE);
|
||||
}
|
||||
|
||||
@@ -17,28 +17,28 @@ import com.mogo.utils.logger.Logger;
|
||||
* 路边摄像头直播控制 V2XPushLiveCarScenario
|
||||
*/
|
||||
public class CameraLiveManager extends AbsCameraScenario<CloudRoadData> implements IMogoTopViewStatusListener {
|
||||
private static final String TAG = "CameraLiveManager";
|
||||
private static CameraLiveManager mCameraLiveCarScenario;
|
||||
private static final String TAG = "liyz";
|
||||
private static CameraLiveManager mCameraLiveManager;
|
||||
private boolean isShowWindow;
|
||||
|
||||
private CameraLiveManager() {
|
||||
}
|
||||
|
||||
public static CameraLiveManager getInstance() {
|
||||
if (mCameraLiveCarScenario == null) {
|
||||
if (mCameraLiveManager == null) {
|
||||
synchronized (CameraLiveManager.class) {
|
||||
if (mCameraLiveCarScenario == null) {
|
||||
mCameraLiveCarScenario = new CameraLiveManager();
|
||||
mCameraLiveCarScenario.setV2XWindow(new PushCameraLiveWindow());
|
||||
if (mCameraLiveManager == null) {
|
||||
mCameraLiveManager = new CameraLiveManager();
|
||||
mCameraLiveManager.setV2XWindow(new PushCameraLiveWindow());
|
||||
}
|
||||
}
|
||||
}
|
||||
return mCameraLiveCarScenario;
|
||||
return mCameraLiveManager;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init(@Nullable CloudRoadData cloudRoadData) {
|
||||
Log.d(TAG, "CameraLiveManager init -----> ");
|
||||
Log.d(TAG, "CameraLiveManager init -----> isShowWindow = " + isShowWindow);
|
||||
if (isShowWindow) {
|
||||
close();
|
||||
}
|
||||
@@ -54,11 +54,10 @@ public class CameraLiveManager extends AbsCameraScenario<CloudRoadData> implemen
|
||||
|
||||
@Override
|
||||
public void showWindow() {
|
||||
Log.d(TAG, "CameraLiveManager showWindow --------");
|
||||
Log.d(TAG, "CameraLiveManager showWindow getV2XWindow = " + getV2XWindow());
|
||||
if (getV2XWindow() != null) {
|
||||
ViewGroup.LayoutParams layoutParams =
|
||||
new ViewGroup.LayoutParams(
|
||||
ViewGroup.LayoutParams.MATCH_PARENT,
|
||||
new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT,
|
||||
(int) AbsMogoApplication.getApp().getResources()
|
||||
.getDimension(R.dimen.module_video_window_height_content));
|
||||
|
||||
@@ -67,7 +66,6 @@ public class CameraLiveManager extends AbsCameraScenario<CloudRoadData> implemen
|
||||
.addViewNoLinkage(getV2XWindow().getView(), layoutParams, this);
|
||||
getV2XWindow().show(getmCloudRoadData());
|
||||
isShowWindow = true;
|
||||
// ExtensionServiceManager.getMoGoV2XStatusManager().setRoadLiveCarWindowShow(TAG, true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -77,7 +75,6 @@ public class CameraLiveManager extends AbsCameraScenario<CloudRoadData> implemen
|
||||
getV2XWindow().close();
|
||||
}
|
||||
isShowWindow = false;
|
||||
// ExtensionServiceManager.getMoGoV2XStatusManager().setRoadLiveCarWindowShow(TAG, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -77,7 +77,7 @@ public class PushCameraLiveWindow extends RelativeLayout implements ICameraWindo
|
||||
Logger.w(TAG, "更新直播信息 show entity = " + entity);
|
||||
if (!TextUtils.isEmpty(entity.getRtmpUrl())) {
|
||||
Logger.w(TAG, "entity.getRtmpUrl() = " + entity.getRtmpUrl());
|
||||
mIvReportHead.setVisibility(VISIBLE);
|
||||
mIvReportHead.setVisibility(INVISIBLE);
|
||||
ExtensionServiceManager.getImageLoader()
|
||||
.displayImage(entity.getRtmpUrl(), mIvReportHead);
|
||||
mLiveGSYVideoView.startLive(entity.getRtmpUrl());
|
||||
|
||||
@@ -3,13 +3,12 @@ package com.mogo.module.extensions.utils;
|
||||
import android.content.Context;
|
||||
import android.graphics.Bitmap;
|
||||
import android.graphics.BitmapFactory;
|
||||
import android.util.Log;
|
||||
|
||||
import com.mogo.commons.AbsMogoApplication;
|
||||
import com.mogo.map.marker.IMogoMarker;
|
||||
import com.mogo.map.marker.IMogoMarkerClickListener;
|
||||
import com.mogo.map.marker.MogoMarkerOptions;
|
||||
import com.mogo.module.common.MogoApisHandler;
|
||||
import com.mogo.module.common.constants.DataTypes;
|
||||
import com.mogo.module.common.entity.CloudRoadData;
|
||||
import com.mogo.module.common.entity.MogoSnapshotSetData;
|
||||
import com.mogo.module.extensions.R;
|
||||
@@ -18,6 +17,7 @@ import com.mogo.module.extensions.live.ExtensionServiceManager;
|
||||
import com.mogo.module.extensions.live.PushDataType;
|
||||
import com.mogo.service.connection.IMogoOnWebSocketMessageListener;
|
||||
import com.mogo.service.connection.WebSocketMsgType;
|
||||
import com.mogo.utils.UiThreadHandler;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
|
||||
|
||||
@@ -26,15 +26,25 @@ import com.mogo.utils.logger.Logger;
|
||||
*
|
||||
*/
|
||||
public class CameraLiveNoticeHelper implements IMogoOnWebSocketMessageListener<MogoSnapshotSetData> {
|
||||
private static final String TAG = "CameraLiveNoticeHelper";
|
||||
private static final String TAG = "liyz";
|
||||
private Context mContext;
|
||||
private static IMogoMarker mMogoMarker;
|
||||
private CloudRoadData mCloudRoadData;
|
||||
|
||||
|
||||
public void init(Context context) {
|
||||
Logger.d(TAG, "init====");
|
||||
Logger.d(TAG, "init ======= ");
|
||||
mContext = context;
|
||||
|
||||
//test
|
||||
// UiThreadHandler.postDelayed( () -> {
|
||||
// mCloudRoadData = new CloudRoadData();
|
||||
// mCloudRoadData.setRtmpUrl("rtmp://58.200.131.2:1935/livetv/hunantv");
|
||||
// mCloudRoadData.setLat(40.200353);
|
||||
// mCloudRoadData.setLon(116.745467);
|
||||
// CameraLiveManager.getInstance().init(mCloudRoadData);
|
||||
// }, 2_000 );
|
||||
|
||||
ExtensionServiceManager
|
||||
.getMogoRegisterCenter().registerMogoMarkerClickListener(PushDataType.TYPE_PUSH_CAMERA_DATA, new IMogoMarkerClickListener() {
|
||||
@Override
|
||||
@@ -66,23 +76,19 @@ public class CameraLiveNoticeHelper implements IMogoOnWebSocketMessageListener<M
|
||||
* @param roadData
|
||||
*/
|
||||
private void addCameraMarker(CloudRoadData roadData) {
|
||||
Logger.d(TAG, "addCameraMarker ------ ");
|
||||
Logger.d(TAG, "addCameraMarker ------lat = " + roadData.getLat() + "--lon =" + roadData.getLon());
|
||||
MogoMarkerOptions options = new MogoMarkerOptions()
|
||||
.object(roadData)
|
||||
.latitude(roadData.getLat())
|
||||
.longitude(roadData.getLon());
|
||||
options.anchor(0.5f, 0.5f);
|
||||
// options.anchor(0.5f, 0.5f);
|
||||
|
||||
Bitmap bitmap = BitmapFactory.decodeResource(mContext.getResources(), R.drawable.module_camera_real_time_traffic, null);
|
||||
options.icon(bitmap);
|
||||
mMogoMarker = MogoApisHandler
|
||||
.getInstance()
|
||||
.getApis()
|
||||
.getMapServiceApi()
|
||||
.getMarkerManager(AbsMogoApplication.getApp())
|
||||
.addMarker(DataTypes.TYPE_MARKER_PUSH_DATA, options);
|
||||
mMogoMarker = ExtensionServiceManager.getMapService().getMarkerManager(mContext)
|
||||
.addMarker(PushDataType.TYPE_PUSH_CAMERA_DATA, options);
|
||||
//TODO
|
||||
|
||||
ExtensionServiceManager.getMapService().getMarkerManager(mContext).addMarker(PushDataType.TYPE_PUSH_CAMERA_DATA, options);
|
||||
}
|
||||
|
||||
private void removeCameraMarker() {
|
||||
@@ -102,19 +108,28 @@ public class CameraLiveNoticeHelper implements IMogoOnWebSocketMessageListener<M
|
||||
return MogoSnapshotSetData.class;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param obj
|
||||
*/
|
||||
@Override
|
||||
public void onMsgReceived(MogoSnapshotSetData obj) {
|
||||
Logger.d(TAG, "onMsgReceived cameralive : " + obj);
|
||||
mCloudRoadData = obj.getTrafficLight();
|
||||
if (mCloudRoadData != null) {
|
||||
Logger.d(TAG, "onMsgReceived cameralive : ");
|
||||
//添加marker TODO
|
||||
addCameraMarker(mCloudRoadData);
|
||||
Logger.d(TAG, "onMsgReceived cameralive : " + obj);
|
||||
if (obj != null) {
|
||||
mCloudRoadData = obj.getCamera();
|
||||
if (mCloudRoadData != null) {
|
||||
Logger.d(TAG, "onMsgReceived getRtmpUrl = " + mCloudRoadData.getRtmpUrl());
|
||||
//添加marker TODO
|
||||
addCameraMarker(mCloudRoadData);
|
||||
} else {
|
||||
//删除marker TODO
|
||||
UiThreadHandler.postDelayed( () -> {
|
||||
removeCameraMarker();
|
||||
}, 2_000 );
|
||||
|
||||
}
|
||||
} else {
|
||||
//删除marker TODO
|
||||
removeCameraMarker();
|
||||
|
||||
Log.e(TAG, "onMsgReceived obj == null ");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user