亚洲精品久久久中文字幕-亚洲精品久久片久久-亚洲精品久久青草-亚洲精品久久婷婷爱久久婷婷-亚洲精品久久午夜香蕉

您的位置:首頁(yè)技術(shù)文章
文章詳情頁(yè)

android - VideoView與百度Map沖突

瀏覽:111日期:2022-10-06 10:32:11

問題描述

我在VideoView上面放了一個(gè)百度的MapView,如果視頻不播放的話,就是不調(diào)用VideoView的start方法,MapView能正常顯示,一旦調(diào)用start方法,MapView就會(huì)變黑,只顯示比例尺和縮放按鈕。布局文件如下:

<?xml version='1.0' encoding='utf-8'?>

<FrameLayout xmlns:android='http://schemas.android.com/apk/res/android'

android:layout_width='match_parent'android:layout_height='match_parent'><ImageView android: android:layout_width='match_parent' android:layout_height='match_parent' android:background='@drawable/saber'/><com.seawolf.test.FullScreeVideoView android: android:layout_width='match_parent' android:layout_height='match_parent' /><RelativeLayout android:layout_width='match_parent' android:layout_height='match_parent' android:paddingTop='@dimen/activity_vertical_margin'> <TextViewandroid: android:layout_width='wrap_content'android:layout_height='wrap_content'android:layout_gravity='left|center_vertical'android:text='yaw'android:layout_centerVertical='true'android:layout_alignParentStart='true' /> <TextViewandroid: android:layout_width='wrap_content'android:layout_height='wrap_content'android:layout_above='@id/yaw_text'android:text='pitch'/> <TextViewandroid: android:layout_width='wrap_content'android:layout_height='wrap_content'android:text='roll'android:layout_above='@id/pitch_text'/> <com.seawolf.test.NavControllerandroid: android:layout_width='wrap_content'android:layout_height='wrap_content'android:layout_alignParentBottom='true'android:layout_alignParentLeft='true'/> <com.baidu.mapapi.map.MapViewandroid: android:layout_width='120dp'android:layout_height='100dp'android:layout_alignParentBottom='true'android:layout_alignParentEnd='true'android:layout_alignTop='@+id/navController'android:background='@color/white'/></RelativeLayout>

</FrameLayout>

public void init() {back_image = (ImageView) findViewById(R.id.back_image);mController = new MediaController(this);mVideo = (VideoView) findViewById(R.id.video);File video = new File('/storage/sdcard1/hd.mp4');if(video.exists()){ mVideo.setVideoPath(video.getAbsolutePath()); // ① // 設(shè)置videoView與mController建立關(guān)聯(lián) mVideo.setMediaController(mController); // ② // 設(shè)置mController與videoView建立關(guān)聯(lián) mController.setMediaPlayer(mVideo); // ③ // 讓VideoView獲取焦點(diǎn) // mVideo.requestFocus(); mVideo.setVisibility(View.INVISIBLE);}else Toast.makeText(MainActivity.this,'The Video is not exist.',Toast.LENGTH_SHORT).show();mMapView = (MapView) findViewById(R.id.map);mMapView.setVisibility(View.INVISIBLE);navController = (NavController) findViewById(R.id.navController);navController.setVisibility(View.INVISIBLE);navController.setOnNavAndSpeedListener(new NavController.OnNavAndSpeedListener() { @Override public void onNavAndSpeed(float nav, float speed) {Toast.makeText(MainActivity.this, 'nav is ' + nav + ',speed is ' + speed, Toast.LENGTH_SHORT).show(); }}); } private void videoStart() {mVideo.setVisibility(View.VISIBLE);mMapView.setVisibility(View.VISIBLE);navController.setVisibility(View.VISIBLE); // mVideo.start(); }

問題解答

回答1:

VideoView和MapView都可以理解為SurfaceView。你可以給VideoView設(shè)置:setZOrderMediaOverlay(true);試試

參考:鏈接1鏈接2

標(biāo)簽: 百度
相關(guān)文章:
主站蜘蛛池模板: 日韩久久久精品中文字幕 | 爱草免费视频 | 亚洲美女在线视频 | 日日噜噜夜夜狠狠久久丁香七 | 可以免费在线看黄的网站 | 好属妞这里只有精品久久 | 性做久久久久久久免费观看 | 国产中文字幕亚洲 | 中文字幕伊人久久网 | 午夜久久久久久网站 | 国产亚洲精品久久久久久牛牛 | 视频在线观看一区二区 | 国产成人精品高清不卡在线 | 日韩欧美一区二区三区不卡视频 | 黄色片免费在线看 | 91看片淫黄大片欧美看国产片 | 黄色免费看网站 | 老人毛片| 国产大片91精品免费观看不卡 | 中国女人野外做爰视频在线看 | 麻豆精品在线视频 | 日本xxxx色视频在线观看 | 免费看色片网站 | 男女晚上日日麻批视频不挡 | 免费特黄一级欧美大片 | 国产精品亚洲欧美日韩区 | 亚洲成年网站在线777 | 91视频网 | 那种视频在线观看 | 亚洲欧美久久一区二区 | 久久香蕉国产 | 久久99爱爱| 中文字字幕在线 | 国产成人不卡亚洲精品91 | 草草影院国产 | 日本在线日本中文字幕日本在线视频播放 | 在线一区二区三区 | 黄色大全视频 | 96色视频 | 欧美日韩一区二区三区免费不卡 | 婷婷综合网 |