真实事件视频播放-无暂停
This commit is contained in:
@@ -289,6 +289,7 @@ public class V2XRoadEventVH extends V2XBaseViewHolder<V2XEventShowEntity> {
|
||||
* */
|
||||
Log.d(TAG,"马上展示图片/视频资源全屏");
|
||||
V2XMessageEntity v2XMessageEntity = new V2XMessageEntity<>();
|
||||
v2XMessageEntity.setContent(v2XEventShowEntity);
|
||||
V2XRoadVideoCarScenario.getInstance().init(v2XMessageEntity);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,7 +11,11 @@ import android.widget.RelativeLayout;
|
||||
import androidx.constraintlayout.widget.ConstraintLayout;
|
||||
|
||||
import com.mogo.map.IDestroyable;
|
||||
import com.mogo.module.common.entity.MarkerExploreWay;
|
||||
import com.mogo.module.common.entity.MarkerExploreWayItem;
|
||||
import com.mogo.module.common.entity.V2XEventShowEntity;
|
||||
import com.mogo.module.common.entity.V2XMessageEntity;
|
||||
import com.mogo.module.common.entity.V2XRoadEventEntity;
|
||||
import com.mogo.module.v2x.R;
|
||||
import com.mogo.module.v2x.V2XServiceManager;
|
||||
import com.mogo.module.v2x.listener.V2XWindowStatusListener;
|
||||
@@ -19,17 +23,18 @@ import com.mogo.module.v2x.scenario.view.IV2XWindow;
|
||||
import com.mogo.module.v2x.view.TextureVideoView;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import retrofit2.http.Url;
|
||||
|
||||
import static com.mogo.module.v2x.V2XConst.MODULE_NAME;
|
||||
|
||||
|
||||
public class V2XRoadVideoWindow extends RelativeLayout implements IV2XWindow , IDestroyable {
|
||||
public class V2XRoadVideoWindow extends RelativeLayout implements IV2XWindow, IDestroyable {
|
||||
|
||||
private static final String TAG = "V2XRoadVideoWindow";
|
||||
private V2XWindowStatusListener mV2XWindowStatusListener;
|
||||
private TextureVideoView mVideoView;
|
||||
private V2XMessageEntity mV2XMessageEntity;
|
||||
private ImageView closeImage;
|
||||
|
||||
public V2XRoadVideoWindow() {
|
||||
@@ -60,20 +65,28 @@ public class V2XRoadVideoWindow extends RelativeLayout implements IV2XWindow , I
|
||||
|
||||
@Override
|
||||
public void show(Object entity) {
|
||||
// mV2XMessageEntity = (V2XMessageEntity) entity;
|
||||
String path = "http://vd4.bdstatic.com//mda-kh0ijgx47i3uu141//v1-cae//mda-kh0ijgx47i3uu141.mp4";
|
||||
mVideoView.setVideoPath(path);
|
||||
if (path != null) {
|
||||
mVideoView.setOnPreparedListener(mediaPlayer -> {
|
||||
Logger.w(MODULE_NAME, "全屏准备。。。。。");
|
||||
});
|
||||
mVideoView.setOnCompletionListener(mediaPlayer -> {
|
||||
Logger.w(MODULE_NAME, "全屏展示结束...");
|
||||
if (mV2XWindowStatusListener != null) {
|
||||
mV2XWindowStatusListener.onViewClose();
|
||||
}
|
||||
});
|
||||
mVideoView.start();
|
||||
V2XEventShowEntity showEntity = (V2XEventShowEntity) entity;
|
||||
V2XRoadEventEntity xRoadEventEntity = showEntity.getV2XRoadEventEntity();
|
||||
ArrayList list = (ArrayList) xRoadEventEntity.getNoveltyInfo().getItems();
|
||||
if (list.size() > 0) {
|
||||
MarkerExploreWayItem item = (MarkerExploreWayItem) list.get(0);
|
||||
String path = item.getUrl();
|
||||
if (path == null) {
|
||||
return;
|
||||
}
|
||||
mVideoView.setVideoPath(path);
|
||||
if (path != null) {
|
||||
mVideoView.setOnPreparedListener(mediaPlayer -> {
|
||||
Logger.w(MODULE_NAME, "全屏准备。。。。。");
|
||||
});
|
||||
mVideoView.setOnCompletionListener(mediaPlayer -> {
|
||||
Logger.w(MODULE_NAME, "全屏展示结束...");
|
||||
if (mV2XWindowStatusListener != null) {
|
||||
mV2XWindowStatusListener.onViewClose();
|
||||
}
|
||||
});
|
||||
mVideoView.start();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user