안녕하세요.
비디오뷰 관련해서 질문이 있습니다.
아래의 Example.xml코드를 실행을 하면, 비디오가 속한 레이아웃을 클릭시 동영상이 오류 없이
잘 실행이 되는데, 이 부분을 그대로 사용해서, 제가 사용하고 있는 맨 아래의 파일의 경우 각각의
switch문마다 개별적으로 비디오를 다른 영상을 넣어주어야 하는데 어떻게 소스를 구성 해야 각 개별적으로
비디오뷰의 동영상을 넣을수 있는지 도무지 그 방법을 잘 모르겠습니다.ㅠㅠ 며칠동안 아래의 Example.xml의
코드를 보면서 제 소스에 적용을 시켜보려고 했는데 함수 부분도 그렇고 시행착오를 너무많이해서
하다하다 못해 질문을 올립니다 ㅠ 어떻게 해주어야 switch부분에서 깔끔하게
만들어 줄수 있을지 모르겠습니다. 8000자가 넘쳐서, 아래의 소스를 좀 더 붙여보겠습니다.
아래의 xml파일부분과, java 파일은 실행을 하면, raw에 있는 있는 fountain.mp4에 영상이 잘 진행이 됩니다
<Example.xml 파일>
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/activity_main"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="com.example.it.vedio.MainActivity">
<LinearLayout
android:onClick="play"
android:clickable="true"
android:paddingTop="2sp"
android:paddingBottom="2sp"
android:tag="fountain_night"
android:id="@+id/video1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<VideoView
android:onClick="play"
android:clickable="true"
android:visibility="visible"
android:layout_marginTop="@dimen/activity_vertical_margin"
android:id="@+id/videoview"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</LinearLayout>
</LinearLayout>
