AIDE Tutorial - 32 Video View
Main xml
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center">
Main xml
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center">
<VideoView
android:id="@+id/video"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</LinearLayout>
android:id="@+id/video"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</LinearLayout>
Java
package com.kc.videoview;
package com.kc.videoview;
import android.app.*;
import android.os.*;
import android.widget.*;
import android.net.*;
import android.os.*;
import android.widget.*;
import android.net.*;
public class MainActivity extends Activity
{
@Override
protected void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
VideoView video=(VideoView)findViewById(R.id.video);
video.setVideoURI(Uri.parse("android.resource://"
+getPackageName() + "/" +R.raw.video));
video.setMediaController(new MediaController(this));
video.requestFocus();
}
}
{
@Override
protected void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
VideoView video=(VideoView)findViewById(R.id.video);
video.setVideoURI(Uri.parse("android.resource://"
+getPackageName() + "/" +R.raw.video));
video.setMediaController(new MediaController(this));
video.requestFocus();
}
}
0 comments:
Post a Comment