URL에서 일부 비디오를 재생하기 위해 VideoView를 코드에서 사용하고 있습니다. 내 VideoView는 ScrollView 내부의 선형 레이아웃 안에 있습니다.
MediaController 객체에 문제가 있습니다. 비디오 뷰의 맨 아래에 다른 뷰가 있습니다. scrollView 내부에있는 뷰와 화면의 상수 위치 (이 경우 화면 아래로 스크롤 된 모든 뷰가이 뷰를 벗어날 때 이동합니다.) 이 MediaController를 상수 위치에 설정하고 싶습니다. 스크롤러로 움직이는 videoView 아래.
내 XML 코드는 여기에 있습니다 :동영상보기 미디어 컨트롤러 Android
<ScrollView
android:id="@+id/scrollView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:layout_marginLeft="94dp"
android:layout_marginTop="196dp" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<AbsoluteLayout
android:id="@+id/nonVideoLayout"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<LinearLayout
android:id="@+id/playerLayout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<com.HRDatis.component.VideoViewQmery
android:id="@+id/playerImage"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</LinearLayout>
그리고 여기에 자바 코드 :에서 onCreate function.Also의 활동에 자바에서 설정 차원의 모든, 나는를 MediaController에 대한 setLayoutparam 기능을 사용하는 것이
((LinearLayout)(findViewById(R.id.playerLayout))).setLayoutParams(new LayoutParams((int)(width) , (int)(height*0.371) ,0 , (int)(height*(0.0))));
VideoViewQmery videoView =((VideoViewQmery)(findViewById(R.id.playerImage)));
MediaController mediaController = new MediaController(this);
mediaController.setAnchorView(videoView);
videoView.setVideoURI(Uri.parse(URI));
videoView.setMediaController(mediaController);
주 하지만 작동하지 않았고 mediaController는 움직이지 않았습니다. SetY 및 SetX 만 작동합니다.이 함수는 VideoView와 관련된 MediaController를 이동하고 내 문제를 해결하지 못했습니다. MediaController가 스크롤과 함께 움직이지 않았습니다. 미리 감사드립니다.